|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jbeans.BaseBeanProperty | +--org.jbeans.DynamicNestedBeanProperty | +--org.jbeans.NestedBeanProperty
This class is used to store information about and handle getting
and setting of both nested and local properties. This class
functions very similarly its parent, DynamicNestedBeanProperty
, except for one slight difference.
This is that when this class is constructed, it takes a property
name that contains the indexes to be used for the indexed properties
in the nesting. For example, if we had a nesting such as:
getIndexed(1).getProperty2().getValue()
you would construct an instance of this class using the property String:
indexed[1].property2.value
This is an important disctinction and was added to the JBeans package because of speed issues and also because many applications could use this static concept for initialization and many other places. Adding in this class reduces the amount of work needed to parse the indices out of the property String and re-format the property String.
One important thing to remember is that after this class has been
constructed, you can still use the
getPropertyValue
, getPropertyValue
, setPropertyValue
, and setPropertyValue
methods from DynamicNestedBeanProperty
.
Fields inherited from class org.jbeans.BaseBeanProperty |
BAD_CONVERT, beanClass, conversionListeners, GET, POST_CONVERT, PRE_CONVERT, propertyListeners, propertyName, propertyType, SET |
Constructor Summary | |
protected |
NestedBeanProperty()
Default constructor that can be used by sub-classes that want to delay the initialization of the propertyName and beanClass or that do not use these members. |
|
NestedBeanProperty(String propertyName,
Class beanClass)
Constructs a new NestedBeanProperty that can be used to describe nested or local properties, depending on the value of the property string (see the class comment for more information). |
|
NestedBeanProperty(String propertyName,
Class beanClass,
boolean strict)
Constructs a new NestedBeanProperty that can be used to describe nested or local properties, depending on the value of the property string (see the class comment for more information). |
|
NestedBeanProperty(String propertyName,
String beanClass)
Constructs a new NestedBeanProperty that can be used to describe nested or local properties, depending on the value of the property string (see the class comment for more information). |
|
NestedBeanProperty(String propertyName,
String beanClass,
boolean strict)
Constructs a new NestedBeanProperty that can be used to describe nested or local properties, depending on the value of the property string (see the class comment for more information). |
Method Summary | |
Object |
getPropertyValue(Object bean)
Returns the value of the local or nested property described by this instance. |
protected void |
initialize()
Initializes all the members of this class by parsing out the propertyName String and creating the necessary BeanProperty class and everything else that might be needed |
void |
setPropertyValue(Object bean,
Object value,
boolean convert)
Sets the local or nested property value described by this instance. |
Methods inherited from class org.jbeans.DynamicNestedBeanProperty |
getPropertyValue, getPropertyValue, getRootProperty, isStrict, setPropertyValue, setPropertyValue, setStrict |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected NestedBeanProperty()
#initialize()
.public NestedBeanProperty(String propertyName, Class beanClass) throws BeanException
propertyName
- The name of the local or nested propertybeanClass
- The class to build the property forBeanException
- If anything went wrong during the parsing of the
property string or building of the property listpublic NestedBeanProperty(String propertyName, String beanClass) throws BeanException
propertyName
- The name of the local or nested propertybeanClass
- The fully qualified name of the bean class to build the
property forBeanException
- If anything went wrong during the parsing of the
property string or building of the property listpublic NestedBeanProperty(String propertyName, Class beanClass, boolean strict) throws BeanException
propertyName
- The name of the property or deep property StringbeanClass
- The class to build the property forstrict
- Determines how this class handles cases when setting and
retrieving property values where nested properties need to be
auto generated because they are nullBeanException
- If anything went wrong during the parsing of
the property string or building of the property listpublic NestedBeanProperty(String propertyName, String beanClass, boolean strict) throws BeanException
propertyName
- The name of the property or deep property StringbeanClass
- The fully qualified name of the bean class to build the
property forstrict
- Determines how this class handles cases when setting and
retrieving property values where nested properties need to be
auto generated because they are nullBeanException
- If anything went wrong during the parsing of
the property string or building of the property listMethod Detail |
protected void initialize() throws BeanException
initialize
in class DynamicNestedBeanProperty
BeanException
- If there were any problems initializing this classpublic Object getPropertyValue(Object bean) throws BeanException
getPropertyValue
in class DynamicNestedBeanProperty
bean
- The bean to retrieve the property onBeanException
- If there was an error getting the JavaBean property or
the getter/is method threw a checked Exception or if strict is true
and a null non-leaf property was encounteredpublic void setPropertyValue(Object bean, Object value, boolean convert) throws BeanException
setPropertyValue
in class DynamicNestedBeanProperty
bean
- The bean instance to set the property onvalue
- The value to set on the beanconvert
- Determines whether or not the value should be converted
to the correct parameter type for the property set methodBeanException
- If there was an error setting the JavaBean property or
the setter method threw a checked Exception or if strict is true
an a null non-leaf property was encountered
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |