Class AttributeReference<VALUECLASS>
java.lang.Object
org.eclnt.jsfserver.pagebean.componentascontrol.valuemgmt.AttributeReference<VALUECLASS>
- All Implemented Interfaces:
IDynamicContentBindingObject
,IValueDelegation<VALUECLASS>
- Direct Known Subclasses:
AttributeReferenceAny
,AttributeReferenceBigDecimal
,AttributeReferenceBigInteger
,AttributeReferenceBoolean
,AttributeReferenceByte
,AttributeReferenceCharacter
,AttributeReferenceDate
,AttributeReferenceDouble
,AttributeReferenceEnum
,AttributeReferenceFloat
,AttributeReferenceInteger
,AttributeReferenceLocalDate
,AttributeReferenceLocalDateTime
,AttributeReferenceLocalTime
,AttributeReferenceLong
,AttributeReferenceShort
,AttributeReferenceString
public abstract class AttributeReference<VALUECLASS>
extends Object
implements IValueDelegation<VALUECLASS>
Value holder that either references a concrete value ("direct value") or a
delegated value (e.g. a wrapped expression). When referencing a delegated
value then a data type mapping transfers the data type of the delegation into
the data type of this instance.
When implementing a page bean component then certain properties of this component can either be directly set or they can reference to existing values. This class is the one to manage these different types of access behind its
For all simple data types there are corresponding inherited extensions of this class, e.g. there is a
When implementing a page bean component then certain properties of this component can either be directly set or they can reference to existing values. This class is the one to manage these different types of access behind its
getValue()
and setValue(Object)
method. For all simple data types there are corresponding inherited extensions of this class, e.g. there is a
AttributeReferenceBigDecimal
and a
AttributeReferenceString
. In cases, in which the the value can have
various types you can use AttributeReferenceAny
.-
Field Summary
Modifier and TypeFieldDescriptionprotected Class
protected VALUECLASS
protected IValueDelegation
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetValue()
When resolving the value from a delegated value (e.g. expression) then the value is mapped into the correct data format.void
initializeValue
(Object attributeValue) This method defines how the instance is managed - either keeping a direct value or as value reference.protected boolean
protected boolean
boolean
Indicates if the reference already received a value through methodsinitializeValue(Object)
.protected VALUECLASS
protected Object
mapToExpressionValue
(Object value) void
setValue
(VALUECLASS value) If the value internally is kept as a delegated value (e.g. expression) then a mapping between the data type of the value and the delegated value is executed.
-
Field Details
-
m_attributeClass
-
m_expressionDelegation
-
m_directValue
-
m_valueInitialized
protected boolean m_valueInitialized
-
-
Constructor Details
-
AttributeReference
-
-
Method Details
-
initializeValue
This method defines how the instance is managed - either keeping a direct value or as value reference.
Direct values can be passed as String. The method then maps the String representation into the correct data type. This only works for simple data types (internally usingSimpleDataTypeMapper
. -
setValue
If the value internally is kept as a delegated value (e.g. expression) then a mapping between the data type of the value and the delegated value is executed.- Specified by:
setValue
in interfaceIValueDelegation<VALUECLASS>
-
getValue
When resolving the value from a delegated value (e.g. expression) then the value is mapped into the correct data format.- Specified by:
getValue
in interfaceIValueDelegation<VALUECLASS>
-
getValueClass
- Specified by:
getValueClass
in interfaceIValueDelegation<VALUECLASS>
-
isValueInitialized
public boolean isValueInitialized()Indicates if the reference already received a value through methodsinitializeValue(Object)
. -
mapToExpressionValue
-
mapFromExpressionValue
-
isUsingExpression
protected boolean isUsingExpression() -
isUsingDirectValue
protected boolean isUsingDirectValue()
-