public class EmbeddedAssignment extends FrameElement
FrameElement
array passed to the helper.
This frame element must otherwise be completely ignored for normal user interface processing. In particular, it is not associated with any widget nor does it change the state, behavior or appearance of the user interface in any way.
Typically, this element is part of a larger array of FrameElement
objects, most
of which do affect the state, behavior and appearance of the user interface. In some cases a
user interface helper method handles assignment of data modified by the user back into the
original object. This operation generally occurs at the end of the helper's processing.
An embedded assignment is one where the assignee and new value are defined in calling code but the actual assignment is done at a later time in the user interface helper. This delegation approach is used where it is necessary to intermix or insert this assignment in a specific order with other embedded assignments and/or with the frame element assignments that may occur.
It is also important to note that the evaluation of the given expression occurs at assignment
time and thus honors the current state of the calling class. This current state includes any
of the variables or fields which have been modified by having had edited widget values
assigned back by earlier FrameElement
objects in the array. Since all of this
assignment processing is done by the user-interface runtime code AND the evaluation of the
embedded assignment expressions must be deferred to that time and inserted in the proper
order, this class is needed to support that behavior.
Modifier and Type | Field and Description |
---|---|
private Accessor |
assignee
The target of the assignment operation.
|
private java.util.function.Supplier<BaseDataType> |
source
The expression to be executed at assignment time.
|
Constructor and Description |
---|
EmbeddedAssignment(Accessor assignee,
BaseDataType val)
Create an instance.
|
EmbeddedAssignment(Accessor assignee,
boolean val)
Create an instance.
|
EmbeddedAssignment(Accessor assignee,
double val)
Create an instance.
|
EmbeddedAssignment(Accessor assignee,
int val)
Create an instance.
|
EmbeddedAssignment(Accessor assignee,
Resolvable source)
Create an instance.
|
EmbeddedAssignment(Accessor assignee,
java.lang.String val)
Create an instance.
|
EmbeddedAssignment(Accessor assignee,
java.util.function.Supplier<BaseDataType> source)
Create an instance.
|
EmbeddedAssignment(BaseDataType assignee,
BaseDataType val)
Create an instance.
|
EmbeddedAssignment(BaseDataType assignee,
boolean val)
Create an instance.
|
EmbeddedAssignment(BaseDataType assignee,
double val)
Create an instance.
|
EmbeddedAssignment(BaseDataType assignee,
int val)
Create an instance.
|
EmbeddedAssignment(BaseDataType assignee,
Resolvable source)
Create an instance.
|
EmbeddedAssignment(BaseDataType assignee,
java.lang.String val)
Create an instance.
|
EmbeddedAssignment(BaseDataType assignee,
java.util.function.Supplier<BaseDataType> source)
Create an instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
assignOnly()
Determines if the element is only for the purpose of assignment or if the element must be
honored as something that can affect the state of the user interface.
|
BaseDataType |
get()
Get a copy of the referenced object's current runtime value (this does not return the
original instance itself).
|
void |
set(BaseDataType val)
Set the referenced object's current runtime value to the given value.
|
bypass, getAccumulator, getFormat, getFormattedValue, getWidget, hasFormat, statsColumn, widgetOnly, wordWrap
private Accessor assignee
private java.util.function.Supplier<BaseDataType> source
public EmbeddedAssignment(BaseDataType assignee, int val)
assignee
- The object to assign. Must NOT be null
.val
- The value to be assigned on a deferred basis.public EmbeddedAssignment(Accessor assignee, int val)
assignee
- The object to assign. Must NOT be null
.val
- The value to be assigned on a deferred basis.public EmbeddedAssignment(BaseDataType assignee, double val)
assignee
- The object to assign. Must NOT be null
.val
- The value to be assigned on a deferred basis.public EmbeddedAssignment(Accessor assignee, double val)
assignee
- The object to assign. Must NOT be null
.val
- The value to be assigned on a deferred basis.public EmbeddedAssignment(BaseDataType assignee, boolean val)
assignee
- The object to assign. Must NOT be null
.val
- The value to be assigned on a deferred basis.public EmbeddedAssignment(Accessor assignee, boolean val)
assignee
- The object to assign. Must NOT be null
.val
- The value to be assigned on a deferred basis.public EmbeddedAssignment(BaseDataType assignee, java.lang.String val)
assignee
- The object to assign. Must NOT be null
.val
- The value to be assigned on a deferred basis.public EmbeddedAssignment(Accessor assignee, java.lang.String val)
assignee
- The object to assign. Must NOT be null
.val
- The value to be assigned on a deferred basis.public EmbeddedAssignment(BaseDataType assignee, BaseDataType val)
assignee
- The object to assign. Must NOT be null
.val
- The value to be assigned on a deferred basis.public EmbeddedAssignment(BaseDataType assignee, Resolvable source)
assignee
- The object to assign. Must NOT be null
.source
- The expression to be evaluated at assignment time.public EmbeddedAssignment(BaseDataType assignee, java.util.function.Supplier<BaseDataType> source)
assignee
- The object to assign. Must NOT be null
.source
- The expression to be evaluated at assignment time.public EmbeddedAssignment(Accessor assignee, BaseDataType val)
assignee
- The object to assign. Must NOT be null
.val
- The value to be assigned on a deferred basis.public EmbeddedAssignment(Accessor assignee, Resolvable source)
assignee
- The object to assign. Must NOT be null
.source
- The expression to be evaluated at assignment time.public EmbeddedAssignment(Accessor assignee, java.util.function.Supplier<BaseDataType> source)
assignee
- The object to assign. Must NOT be null
.source
- The expression to be evaluated at assignment time.public boolean assignOnly()
assignOnly
in class FrameElement
true
;public BaseDataType get()
This is unsupported for embedded assignments.
public void set(BaseDataType val)
val
- The current value to be assigned into the referenced object. This value will be
ignored for embedded assignments and can be passed as null
.