Package org.apache.axis.utils
Class BeanPropertyDescriptor
java.lang.Object
org.apache.axis.utils.BeanPropertyDescriptor
- Direct Known Subclasses:
FieldPropertyDescriptor
This class represents a field/property in a value type (a class with either
bean-style getters/setters or public fields).
It is essentially a thin wrapper around the PropertyDescriptor from the
JavaBean utilities. We wrap it with this class so that we can create
the subclass FieldPropertyDescriptor and access public fields (who
wouldn't have PropertyDescriptors normally) via the same interface.
There are also some interesting tricks where indexed properties are
concerned, mostly involving the fact that we manage the arrays here
rather than relying on the value type class to do it itself.
- Author:
- Rich Scheuerle <scheu@us.ibm.com>, Glen Daniels (gdaniels@apache.org)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static org.apache.commons.logging.Log
protected PropertyDescriptor
protected static final Object[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Protected constructor for use by our childrenConstructor (takes a PropertyDescriptor) -
Method Summary
Modifier and TypeMethodDescriptionGet the property valueGet an indexed propertygetName()
Get our property name.getType()
Get the type of a propertyprotected void
growArrayToSize
(Object obj, Class componentType, int i) Grow the arrayboolean
isArray()
Query if property is an array (excluded byte[]).boolean
Query if property is indexedboolean
Query if property is indexed or if it' an array.boolean
Query if property is readableboolean
Query if property is writeablevoid
Set an indexed property valuevoid
Set the property value
-
Field Details
-
log
protected static org.apache.commons.logging.Log log -
myPD
-
noArgs
-
-
Constructor Details
-
BeanPropertyDescriptor
Constructor (takes a PropertyDescriptor)- Parameters:
pd
-
-
BeanPropertyDescriptor
protected BeanPropertyDescriptor()Protected constructor for use by our children
-
-
Method Details
-
getName
Get our property name. -
isReadable
public boolean isReadable()Query if property is readable- Returns:
- true if readable
-
isWriteable
public boolean isWriteable()Query if property is writeable- Returns:
- true if writeable
-
isIndexed
public boolean isIndexed()Query if property is indexed- Returns:
- true if indexed methods exist
-
isIndexedOrArray
public boolean isIndexedOrArray()Query if property is indexed or if it' an array.- Returns:
- true if indexed methods exist or if it's an array
-
isArray
public boolean isArray()Query if property is an array (excluded byte[]).- Returns:
- true if it's an array (excluded byte[])
-
get
Get the property value- Parameters:
obj
- is the object- Returns:
- the entire propery value
- Throws:
InvocationTargetException
IllegalAccessException
-
set
public void set(Object obj, Object newValue) throws InvocationTargetException, IllegalAccessException Set the property value- Parameters:
obj
- is the objectnewValue
- is the new value- Throws:
InvocationTargetException
IllegalAccessException
-
get
Get an indexed property- Parameters:
obj
- is the objecti
- the index- Returns:
- the object at the indicated index
- Throws:
InvocationTargetException
IllegalAccessException
-
set
public void set(Object obj, int i, Object newValue) throws InvocationTargetException, IllegalAccessException Set an indexed property value- Parameters:
obj
- is the objecti
- the indexnewValue
- is the new value- Throws:
InvocationTargetException
IllegalAccessException
-
growArrayToSize
protected void growArrayToSize(Object obj, Class componentType, int i) throws InvocationTargetException, IllegalAccessException Grow the array- Parameters:
obj
-componentType
-i
-- Throws:
InvocationTargetException
IllegalAccessException
-
getType
Get the type of a property- Returns:
- the type of the property
-
getActualType
-