org.apache.axis.utils
Class BeanPropertyDescriptor

java.lang.Object
  |
  +--org.apache.axis.utils.BeanPropertyDescriptor

public class BeanPropertyDescriptor
extends java.lang.Object

This class is essentially a copy of the PropertyDescriptor information, except that the values in it can be modified. Updated this to include fields that don't have getter/setters.

Author:
Rich Scheuerle

Field Summary
protected static org.apache.commons.logging.Log log
           
 
Constructor Summary
BeanPropertyDescriptor(java.lang.String _name, java.lang.reflect.Field _field)
          Construct a BPD with a field Both must be set
BeanPropertyDescriptor(java.lang.String _name, java.lang.reflect.Method _getter, java.lang.reflect.Method _setter)
          Construct a BPD with getter/setter methods Both must be set
BeanPropertyDescriptor(java.lang.String _name, java.lang.reflect.Method _getter, java.lang.reflect.Method _setter, java.lang.reflect.Method _getterIndexed, java.lang.reflect.Method _setterIndexed)
          Construct a BPD with getter/setter methods for an indexed property.
 
Method Summary
 java.lang.Object get(java.lang.Object obj)
          Get the property value
 java.lang.Object get(java.lang.Object obj, int i)
          Get an indexed property
 java.lang.String getName()
          Get the name of a property
 java.lang.Class getType()
          Get the type of a property
 boolean isIndexed()
          Query if property is indexed.
 boolean isReadable()
          Query if property is readable
 boolean isWriteable()
          Query if property is writeable
 void set(java.lang.Object obj, int i, java.lang.Object newValue)
          Set an indexed property value
 void set(java.lang.Object obj, java.lang.Object newValue)
          Set the property value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
Constructor Detail

BeanPropertyDescriptor

public BeanPropertyDescriptor(java.lang.String _name,
                              java.lang.reflect.Method _getter,
                              java.lang.reflect.Method _setter)
Construct a BPD with getter/setter methods Both must be set
Parameters:
String - _name is the name of the property
Method - _getter is the accessor method
Method - _setter is the modifier method

BeanPropertyDescriptor

public BeanPropertyDescriptor(java.lang.String _name,
                              java.lang.reflect.Method _getter,
                              java.lang.reflect.Method _setter,
                              java.lang.reflect.Method _getterIndexed,
                              java.lang.reflect.Method _setterIndexed)
Construct a BPD with getter/setter methods for an indexed property. All params must be set.
Parameters:
String - _name is the name of the property
Method - _getter is the accessor method
Method - _setter is the modifier method
Method - _getterIndexed is the accessor method
Method - _setterIndexed is the modifier method

BeanPropertyDescriptor

public BeanPropertyDescriptor(java.lang.String _name,
                              java.lang.reflect.Field _field)
Construct a BPD with a field Both must be set
Parameters:
String - _name is the name of the property
Field - _field is the name of the public instance field
Method Detail

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. Indexed properties require valid setters/getters
Returns:
true if indexed methods exist

get

public java.lang.Object get(java.lang.Object obj)
                     throws java.lang.reflect.InvocationTargetException,
                            java.lang.IllegalAccessException
Get the property value
Parameters:
obj - is the object
Returns:
the entire propery value

set

public void set(java.lang.Object obj,
                java.lang.Object newValue)
         throws java.lang.reflect.InvocationTargetException,
                java.lang.IllegalAccessException
Set the property value
Parameters:
obj - is the object
is - the new value

get

public java.lang.Object get(java.lang.Object obj,
                            int i)
                     throws java.lang.reflect.InvocationTargetException,
                            java.lang.IllegalAccessException
Get an indexed property
Parameters:
obj - is the object
i - the index
Returns:
the object at the indicated index

set

public void set(java.lang.Object obj,
                int i,
                java.lang.Object newValue)
         throws java.lang.reflect.InvocationTargetException,
                java.lang.IllegalAccessException
Set an indexed property value
Parameters:
obj - is the object
i - the index
newValue - is the new value

getName

public java.lang.String getName()
Get the name of a property
Returns:
String name of the property

getType

public java.lang.Class getType()
Get the type of a property
Returns:
the type of the property


Copyright © 2002 Apache XML Project. All Rights Reserved.