|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||
Attributed
to work with dynamic attributes of objects and base implementations of this interface.
See:
Description
| Interface Summary | |
|---|---|
| Attributed | Attributed object is a Java object decorated by attributes. |
| Class Summary | |
|---|---|
| Accessor | This is a collection of static methods to work with different implementations of attributes. |
| BeanMapAttributed | The implementation of Attributed interface that accesses attributes
through getter and setter methods according to JavaBeans
naming conventions and stores additional attributes in Map. |
| BeanWrapper | The implementation of Attributed interface that accesses attributes
through getter and setter methods according to JavaBeans
naming conventions. |
| IndexedAttributedImpl | The default implementation of Attributed methods that
deals with indexed attributes. |
| MapAttributed | The implementation of Attributed interface that stores attributes
in Map. |
| Exception Summary | |
|---|---|
| AttributeException | This exception reports about various problems with attribute: wrong name, type, acces violation etc. |
| AttributePathException | This exception reports about various problems while getting attribute value by attribute path: syntax errors in attribute path, wrong attribute names etc. |
This package provides base interface Attributed
to work with dynamic attributes of objects and base implementations of this interface.
Dynamic attribute of an object is a value linked with this object.
A name of attribute is a string
identifier.
A value of attribute can be any object, types are not checked.
Set of dynamic attributes of an object can be changed at run-time. For given attribute name attribute value can be obtained or changed.
For attributes with array or list value
(List)
additional operations to work with elements are defined.
Various implementations are possible:
MapAttributed
- values of attributes are stored in map(Map).BeanWrapper - wrapper for
any object. Attributes are accessed using JavaBeans naming conventions.BeanMapAttributed
- attributes are accessed using JavaBeans naming conventions or in map
(Map) if JavaBean access method failed.
So, this is cobination of two previous implementations.JavaBeans naming conventions set that operations for attribute
<name> defined in methods <Type> get<Name>()
and void set<Name>( <Type> ), where <Name>
is attribute name <name>, with capitalized first letter,
and <Type> is type of the attribute.
For boolean attributes accessor method boolean is<Name>()
is used in first place, if it is not found - boolean get<Name>().
When trying to call operation for attribute <name>, get-method is searched.
If it is found, then attribute exists and the method can be used to access value of attribute.
When trying to change value of attribute, set-method are searched for given type and name
of attribute. If it is found, it can be used to change value of attribute.
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||