|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
T - Generic type, see ValueEngineerFactory.getType().public interface ValueEngineer<T>
Engineer operating on values. Used to persist values and
ValueEngineer.read(List read) values back from persistence. Implementations may
provide further functionality on values through aspects.
The broker provided to methods of this interface and implemented aspects offers additional, specialized agents:
ReferenceTransformationAgent for transforming reference containers to elements
ReferenceTransformationAgent| Method Summary | ||
|---|---|---|
T |
copy(T original)
Create a copy of the given value, i.e., it produces a new instance having the same contents. |
|
|
getAspect(ValueEngineerAspectType<T> aspect)
Request an aspect of the given type. |
|
T |
getEmpty()
Create an empty (initial) value. |
|
boolean |
isEmpty(T value)
Check if the provided value is empty. |
|
T |
read(List<Node> nodes)
Read the value. |
|
List<Node> |
write(T value)
Persist the given value. |
|
| Method Detail |
|---|
@NotNull
List<Node> write(@NotNull
T value)
value - The value to write as list of nodes.
ValueEngineer.read(List)
@Nullable
T read(@NotNull
List<Node> nodes)
If instances are language specific pay attention to inject the correct language in the returned instance. You
can obtain the language from ValueEngineerContext.getLanguage().
nodes - The nodes representing a value.
ValueEngineer.write(Object)@Nullable T getEmpty()
null if no special empty value treatment is
needed. If the returned value is not null the following condition should hold:
isEmpty(getEmpty()) == true
If instances are language specific pay attention to inject the correct language in the returned instance. You
can obtain the language from ValueEngineerContext.getLanguage().
T or null.ValueEngineer.isEmpty(Object)
boolean isEmpty(@NotNull
T value)
value - Value to check.
true if the provided value is empty.ValueEngineer.getEmpty()
@NotNull
T copy(@NotNull
T original)
For mutable object the following condition should hold for a given original and its copy:
original != copy
For immutable objects (e.g. Strings) you may return the provided original itself.
If instances are language specific pay attention to inject the correct language in the returned instance. You
can obtain the language from ValueEngineerContext.getLanguage().
original - The value to be copied.
@Nullable
<T> T getAspect(@NotNull
ValueEngineerAspectType<T> aspect)
The following aspects may be provided by an engineer:
ReferenceContaining, if the value may contain store element referencesMatchSupporting, if the value supports indexing and searchingDifferenceComputing, if the engineer provides means to compute differences between valuesValidationSupporting, if the engineer provides means to validate values
aspect - The aspect requested.
null, if the requested aspect is not supported.ReferenceContaining,
MatchSupporting,
DifferenceComputing,
ValidationSupporting
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||