Class ComponentAdapterByAnnotationForBeanProperty<BEANCLASS>
java.lang.Object
org.eclnt.jsfserver.elements.adapter.ComponentAdapterByAnnotation
org.eclnt.jsfserver.elements.adapter.ComponentAdapterByAnnotationForBeanProperty<BEANCLASS>
- All Implemented Interfaces:
Serializable
,IComponentAdapterBinding
,IComponentAdapterBinding2
,IDynamicContentBindingObject
public class ComponentAdapterByAnnotationForBeanProperty<BEANCLASS>
extends ComponentAdapterByAnnotation
Component adapter that is based on reflection AND that binds one dedicated
component attribute to a bean property. The bean is either directly
passed or indirectly passed using interface
The bean property does not have to be implemented (and annotated) in any way but is directly available by
The property can be passed as normal string (e.g. "firstName") - in this it represents a direct property of the bean. Or it can be passed as string sequence (e.g. "address$street"), in this case it is a property that is reached by bean- navigation.
IBeanAccess
.
The bean property does not have to be implemented (and annotated) in any way but is directly available by
#getPropertyValue(Object)
and
setPropertyValue(Object)
.
The property can be passed as normal string (e.g. "firstName") - in this it represents a direct property of the bean. Or it can be passed as string sequence (e.g. "address$street"), in this case it is a property that is reached by bean- navigation.
- See Also:
-
Constructor Summary
ConstructorDescriptionComponentAdapterByAnnotationForBeanProperty
(BEANCLASS bean, String property) Constructor in which the component attribute is not passed.ComponentAdapterByAnnotationForBeanProperty
(String componentAttribute, BEANCLASS bean, String property) ComponentAdapterByAnnotationForBeanProperty
(String componentAttribute, IBeanAccess<BEANCLASS> beanAccess, String property) ComponentAdapterByAnnotationForBeanProperty
(IBeanAccess<BEANCLASS> beanAccess, String property) Constructor in which the component attribute is not passed. -
Method Summary
Modifier and TypeMethodDescriptiongetAttibuteType
(String attributeName) This method needs only to be implemented for these attributes which are set later on.getAttributeValue
(String attributeName) Get the attribute value for an attribute.getBean()
Access to bean object.Name of the attributes that are dynamic over the whole lifecycle of the corresponding object.Access to bean property value.void
initComponentAttribute
(String attributeName) If not passing the component attribute by a constructor then the component attribute needs to be passed by this method - before the component binding is first time accessed by the component processing.void
setAttributeValue
(String attributeName, Object value) Set the attribute value.void
setPropertyValue
(Object value) Access to bean property value.Methods inherited from class org.eclnt.jsfserver.elements.adapter.ComponentAdapterByAnnotation
addActionListener, getExportValue, getExportValueFormat, getExportValueFormatmask, getExportValueTimezone, getFixAttributeNames, getSortValue, initComponent, onAction, removeActionListener
-
Constructor Details
-
ComponentAdapterByAnnotationForBeanProperty
public ComponentAdapterByAnnotationForBeanProperty(String componentAttribute, BEANCLASS bean, String property) - Parameters:
componentAttribute
- Name of the attribute (e.g. "text" for a FIELD-component) that is served by the bean-propertybean
- Bean instanceproperty
- Property name
-
ComponentAdapterByAnnotationForBeanProperty
public ComponentAdapterByAnnotationForBeanProperty(String componentAttribute, IBeanAccess<BEANCLASS> beanAccess, String property) - Parameters:
componentAttribute
- Name of the attribute (e.g. "text" for a FIELD-component) that is served by the bean-propertybeanAccess
- Interface which is passed to access the bean. In this case the bean is not directly passed into this object but "indirectly" accessed only. Advantage: the user of this instance can exchange the bean without having to update the bean in all adapter binding instances.property
- Property name
-
ComponentAdapterByAnnotationForBeanProperty
Constructor in which the component attribute is not passed. You must make sure thatinitComponentAttribute(String)
is called prior to first access to the adapter binding by the component processing. -
ComponentAdapterByAnnotationForBeanProperty
public ComponentAdapterByAnnotationForBeanProperty(IBeanAccess<BEANCLASS> beanAccess, String property) Constructor in which the component attribute is not passed. You must make sure thatinitComponentAttribute(String)
is called prior to first access to the adapter binding by the component processing.
-
-
Method Details
-
initComponentAttribute
If not passing the component attribute by a constructor then the component attribute needs to be passed by this method - before the component binding is first time accessed by the component processing. -
getDynamicAttributeNames
Description copied from interface:IComponentAdapterBinding
Name of the attributes that are dynamic over the whole lifecycle of the corresponding object.- Specified by:
getDynamicAttributeNames
in interfaceIComponentAdapterBinding
- Overrides:
getDynamicAttributeNames
in classComponentAdapterByAnnotation
-
setAttributeValue
Description copied from interface:IComponentAdapterBinding
Set the attribute value. This only needs to be implemented for these attributes that are actually set (e.g. in case of a FIELD component only the attribute that manages the TEXT attribute needs to implement the corresponding reaction).- Specified by:
setAttributeValue
in interfaceIComponentAdapterBinding
- Overrides:
setAttributeValue
in classComponentAdapterByAnnotation
-
getAttibuteType
Description copied from interface:IComponentAdapterBinding
This method needs only to be implemented for these attributes which are set later on. It needs not to be implemented for these attributes that are "get-only". In case of returning null as type the default mechanism will be used for transferring the UI value into an object value.- Specified by:
getAttibuteType
in interfaceIComponentAdapterBinding
- Overrides:
getAttibuteType
in classComponentAdapterByAnnotation
-
getAttributeValue
Description copied from interface:IComponentAdapterBinding
Get the attribute value for an attribute.- Specified by:
getAttributeValue
in interfaceIComponentAdapterBinding
- Overrides:
getAttributeValue
in classComponentAdapterByAnnotation
-
getPropertyType
-
getPropertyValue
Access to bean property value. -
setPropertyValue
Access to bean property value. -
getBean
Access to bean object. The bean either is directly available or is available by interfaceIBeanAccess
- dependent from the information passed in the constructor. -
getProperty
-