public class IlvPropertyDescriptor extends Object
IlvPropertyDescriptor
extends the capabilities of the
standard java.lang.reflect.PropertyDescriptor
to describe a
user-defined property of an IlvUserPropertyHolder
or a standard
JavaBean property.Constructor and Description |
---|
IlvPropertyDescriptor(Class clazz,
String property)
Creates a descriptor that describes the specified user-defined property of
an
IlvUserPropertyHolder or the specified standard Java Bean
property. |
Modifier and Type | Method and Description |
---|---|
static Object |
getProperty(Object obj,
String property)
Returns the value of a user-defined or Java Bean property.
|
static IlvPropertyDescriptor |
getPropertyDescriptor(Class clazz,
String property)
Returns the descriptor that describes the specified user-defined property
of an
IlvUserPropertyHolder or the specified standard Java Bean
property. |
Object |
getValue(Object obj)
Returns the property value from the specified object.
|
void |
setProperty(Object obj,
String property,
Object value)
Sets the value of a user-defined or Java Bean property.
|
void |
setValue(Object obj,
Object value)
Sets the property value on the specified object.
|
public IlvPropertyDescriptor(Class clazz, String property) throws IntrospectionException
IlvUserPropertyHolder
or the specified standard Java Bean
property. For better performance, you should not construct descriptors
directly. Instead, use the static getPropertyDescriptor(java.lang.Class, java.lang.String)
method
which caches the descriptors.clazz
- The Class
object for the target
IlvUserPropertyHolder
implementation or for the target Java Bean.property
- The name of the property.IntrospectionException
- if an exception occurs during
introspection.IntrospectionException
public Object getValue(Object obj) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
obj
- The object, which must be an instance of the class for which
this descriptor was created.IllegalAccessException
IllegalArgumentException
InvocationTargetException
setValue(java.lang.Object, java.lang.Object)
public void setValue(Object obj, Object value) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
obj
- The object, which must be an instance of the class for which
this descriptor was created.value
- The property value.IllegalAccessException
IllegalArgumentException
InvocationTargetException
getValue(java.lang.Object)
public static IlvPropertyDescriptor getPropertyDescriptor(Class clazz, String property) throws IntrospectionException
IlvUserPropertyHolder
or the specified standard Java Bean
property. If the property descriptor has been previously created, it will
be returned from the cache.clazz
- The Class
object for the target
IlvUserPropertyHolder
implementation or for the target Java Bean.property
- The name of the property.IntrospectionException
- if an exception occurs during
introspection.IntrospectionException
public static Object getProperty(Object obj, String property) throws IntrospectionException, InvocationTargetException
null
.
the property does not exist.obj
- The target IlvUserPropertyHolder
implementation or the
target Java Bean.property
- The name of the property.null
if the property
does not exist.IntrospectionException
- if an exception occurs during
introspection.IntrospectionException
InvocationTargetException
setProperty(java.lang.Object, java.lang.String, java.lang.Object)
public void setProperty(Object obj, String property, Object value) throws IntrospectionException, InvocationTargetException
obj
- The target IlvUserPropertyHolder
implementation or the
target Java Bean.property
- The name of the property.value
- The value of the property.IntrospectionException
- if an exception occurs during
introspection.IntrospectionException
InvocationTargetException
getProperty(java.lang.Object, java.lang.String)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.