|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--org.jbeans.BaseBeanProperty
|
+--org.jbeans.BeanProperty
|
+--org.jbeans.IndexedBeanProperty
This class is used to access an indexed JavaBean property. Normal indexed JavaBean properties take a single int parameter, in addition to the value parameter for setters, that indicates the index into an array or collection of values.
| Fields inherited from class org.jbeans.BeanProperty |
read, write |
| Fields inherited from class org.jbeans.BaseBeanProperty |
BAD_CONVERT, beanClass, conversionListeners, GET, POST_CONVERT, PRE_CONVERT, propertyListeners, propertyName, propertyType, SET |
| Constructor Summary | |
protected |
IndexedBeanProperty()
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. |
|
IndexedBeanProperty(String propertyName,
Class beanClass)
Constructs a new indexed bean property using the property name and bean class given. |
|
IndexedBeanProperty(String propertyName,
String beanClass)
Constructs a new indexed bean property using the property name and fully qualified name of the bean class given. |
| Method Summary | |
Object |
getPropertyValue(Object bean)
This method is not implemented and will throw an exception |
Object |
getPropertyValue(Object bean,
int index)
Returns the value of the indexed JavaBean property at the given index |
protected void |
initialize()
Initializes the bean property by finding the read and write methods and setting up the propertyType for this BeanProperty. |
void |
setPropertyValue(Object bean,
int index,
Object value)
Sets the value of the indexed JavaBean property at the given index with the given value. |
void |
setPropertyValue(Object bean,
int index,
Object value,
boolean convert)
Sets the value of the indexed JavaBean property at the given index with the given value |
void |
setPropertyValue(Object bean,
Object value,
boolean convert)
This method is not implemented and will throw an exception |
| Methods inherited from class org.jbeans.BeanProperty |
getBeanClass, getReadMethod, getWriteMethod |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected IndexedBeanProperty()
#initialize().
public IndexedBeanProperty(String propertyName,
Class beanClass)
throws BeanException
If the bean class does not have a write method (set method) than the property is considered read-only. The bean class MUST have a read method (get method) or this method will throw and exception. This method calls the super-class constructor with the same signature.
propertyName - The name of the indexed JavaBean propertybeanClass - The Class object used to find the read and write methods
for the indexed JavaBean propertyBeanException - If the property is invalid or does not exist in
the bean class given
public IndexedBeanProperty(String propertyName,
String beanClass)
throws BeanException
If the bean class does not have a write method (set method) than the property is considered read-only. The bean class MUST have a read method (get method) or this method will throw and exception. This method calls the super-class constructor with the same signature.
propertyName - The name of the indexed JavaBean propertybeanClass - The fully qualified name of the bean Class object used to
find the read and write methods for the indexed Java bean propertyBeanException - If the property is invalid or does not exist in
the bean class given| Method Detail |
protected void initialize()
throws BeanException
initialize in class BeanPropertyBeanException - If the bean class does not contain the property
public Object getPropertyValue(Object bean,
int index)
throws BeanException
bean - The instance of the JavaBean to retrieve the indexed property
from.index - The index of the JavaBean property to retrieve, this is also the
parameter to the getterBeanException - If there was an error getting the JavaBean property or
the getter/is method threw a checked Exception
public Object getPropertyValue(Object bean)
throws BeanException
getPropertyValue in class BeanPropertyorg.jbeans.BeanPropertybean - The instance of the Java bean to retrieve the property fromBeanException - If there was an error getting the Java bean property or
the getter/is method threw a checked Exception
public void setPropertyValue(Object bean,
int index,
Object value,
boolean convert)
throws BeanException,
TypeConversionException
bean - The instance of the JavaBean to set the indexed property onindex - The index to set to value ofvalue - The value to set the indexed property toconvert - Determines whether or not value should be converted
to the type that the setter requires or notBeanException - If there was an error setting the JavaBean property or
the setter method threw a checked ExceptionTypeConversionException - If there was a problem auto-converting the
property value
public void setPropertyValue(Object bean,
int index,
Object value)
throws BeanException
bean - The instance of the JavaBean to set the indexed property onindex - The index to set to value ofvalue - The value to set the indexed property toBeanException - If there was an error setting the JavaBean property or
the setter method threw a checked Exception
public void setPropertyValue(Object bean,
Object value,
boolean convert)
throws BeanException
setPropertyValue in class BeanPropertyorg.jbeans.BeanPropertybean - The instance of the Java bean to set the property onvalue - The value to set the property toconvert - Determines whether or not value should be converted
to the type that the setter requires or notBeanException - If there was an error setting the Java bean property or
the setter method threw a checked ExceptionTypeConversionException - If there was a problem auto-converting the
property value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||