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 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 Details

    • m_attributeClass

      protected Class m_attributeClass
    • m_expressionDelegation

      protected IValueDelegation m_expressionDelegation
    • m_directValue

      protected VALUECLASS m_directValue
    • m_valueInitialized

      protected boolean m_valueInitialized
  • Constructor Details

    • AttributeReference

      public AttributeReference(Class attributeClass)
  • Method Details

    • initializeValue

      public void initializeValue(Object attributeValue)
      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 using SimpleDataTypeMapper.
    • setValue

      public 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.
      Specified by:
      setValue in interface IValueDelegation<VALUECLASS>
    • getValue

      public 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 interface IValueDelegation<VALUECLASS>
    • getValueClass

      public Class getValueClass()
      Specified by:
      getValueClass in interface IValueDelegation<VALUECLASS>
    • isValueInitialized

      public boolean isValueInitialized()
      Indicates if the reference already received a value through methods initializeValue(Object).
    • mapToExpressionValue

      protected Object mapToExpressionValue(Object value)
    • mapFromExpressionValue

      protected VALUECLASS mapFromExpressionValue()
    • isUsingExpression

      protected boolean isUsingExpression()
    • isUsingDirectValue

      protected boolean isUsingDirectValue()