org.apache.axis.utils
Class BeanPropertyDescriptor
java.lang.Object
org.apache.axis.utils.BeanPropertyDescriptor
public class BeanPropertyDescriptor
extends java.lang.Object
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.
- Rich Scheuerle
- Glen Daniels (gdaniels@apache.org)
protected static Log | log
|
protected PropertyDescriptor | myPD
|
protected static Object[] | noArgs
|
Object | get(Object obj) - Get the property value
|
Object | get(Object obj, int i) - Get an indexed property
|
Class | getActualType()
|
String | getName() - Get our property name.
|
Class | getType() - Get the type of a property
|
protected void | growArrayToSize(Object obj, Class componentType, int i) - Grow the array
|
boolean | isArray() - Query if property is an array (excluded byte[]).
|
boolean | isIndexed() - Query if property is indexed
|
boolean | isIndexedOrArray() - Query if property is indexed or if it' an array.
|
boolean | isReadable() - Query if property is readable
|
boolean | isWriteable() - Query if property is writeable
|
void | set(Object obj, Object newValue) - Set the property value
|
void | set(Object obj, int i, Object newValue) - Set an indexed property value
|
log
protected static Log log
myPD
protected PropertyDescriptor myPD
noArgs
protected static final Object[] noArgs
BeanPropertyDescriptor
protected BeanPropertyDescriptor()
Protected constructor for use by our children
BeanPropertyDescriptor
public BeanPropertyDescriptor(PropertyDescriptor pd)
Constructor (takes a PropertyDescriptor)
get
public Object get(Object obj)
throws InvocationTargetException,
IllegalAccessException
Get the property value
get
public Object get(Object obj,
int i)
throws InvocationTargetException,
IllegalAccessException
Get an indexed property
obj
- is the objecti
- the index
- the object at the indicated index
getActualType
public Class getActualType()
getName
public String getName()
Get our property name.
getType
public Class getType()
Get the type of a property
growArrayToSize
protected void growArrayToSize(Object obj,
Class componentType,
int i)
throws InvocationTargetException,
IllegalAccessException
Grow the array
obj
- componentType
- i
-
isArray
public boolean isArray()
Query if property is an array (excluded byte[]).
- true if it's an array (excluded byte[])
isIndexed
public boolean isIndexed()
Query if property is indexed
- true if indexed methods exist
isIndexedOrArray
public boolean isIndexedOrArray()
Query if property is indexed or if it' an array.
- true if indexed methods exist or if it's an array
isReadable
public boolean isReadable()
Query if property is readable
isWriteable
public boolean isWriteable()
Query if property is writeable
set
public void set(Object obj,
Object newValue)
throws InvocationTargetException,
IllegalAccessException
Set the property value
obj
- is the objectnewValue
- is the new value
set
public void set(Object obj,
int i,
Object newValue)
throws InvocationTargetException,
IllegalAccessException
Set an indexed property value
obj
- is the objecti
- the indexnewValue
- is the new value
Copyright © 2005 Apache Web Services Project. All Rights Reserved.