|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.beanutils.WrapDynaClass
Implementation of DynaClass
for DynaBeans that wrap
standard JavaBean instances.
Field Summary | |
protected java.lang.Class |
beanClass
The JavaBean Class which is represented by this
WrapDynaClass . |
protected java.beans.PropertyDescriptor[] |
descriptors
The set of PropertyDescriptors for this bean class. |
protected java.util.HashMap |
descriptorsMap
The set of PropertyDescriptors for this bean class, keyed by the property name. |
protected static java.util.HashMap |
dynaClasses
The set of WrapDynaClass instances that have ever been
created, keyed by the underlying bean Class. |
protected DynaProperty[] |
properties
The set of dynamic properties that are part of this DynaClass. |
protected java.util.HashMap |
propertiesMap
The set of dynamic properties that are part of this DynaClass, keyed by the property name. |
Constructor Summary | |
private |
WrapDynaClass(java.lang.Class beanClass)
Construct a new WrapDynaClass for the specified JavaBean class. |
Method Summary | |
static void |
clear()
Clear our cache of WrapDynaClass instances. |
static WrapDynaClass |
createDynaClass(java.lang.Class beanClass)
Create (if necessary) and return a new WrapDynaClass
instance for the specified bean class. |
DynaProperty[] |
getDynaProperties()
Return an array of ProperyDescriptors for the properties
currently defined in this DynaClass. |
DynaProperty |
getDynaProperty(java.lang.String name)
Return a property descriptor for the specified property, if it exists; otherwise, return null . |
java.lang.String |
getName()
Return the name of this DynaClass (analogous to the getName() method of java.lang.Class DynaClass implementation class to support
different dynamic classes, with different sets of properties. |
java.beans.PropertyDescriptor |
getPropertyDescriptor(java.lang.String name)
Return the PropertyDescriptor for the specified property name, if any; otherwise return null . |
protected void |
introspect()
Introspect our bean class to identify the supported properties. |
DynaBean |
newInstance()
Instantiate and return a new DynaBean instance, associated with this DynaClass. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.Class beanClass
Class
which is represented by this
WrapDynaClass
.
protected java.beans.PropertyDescriptor[] descriptors
protected java.util.HashMap descriptorsMap
descriptors
list.
protected DynaProperty[] properties
protected java.util.HashMap propertiesMap
properties
list.
protected static java.util.HashMap dynaClasses
WrapDynaClass
instances that have ever been
created, keyed by the underlying bean Class.
Constructor Detail |
private WrapDynaClass(java.lang.Class beanClass)
createDynaClass(Class)
method.
beanClass
- JavaBean class to be introspected aroundMethod Detail |
public java.lang.String getName()
getName()
method of java.lang.Class
DynaClass implementation class to support
different dynamic classes, with different sets of properties.
getName
in interface DynaClass
public DynaProperty getDynaProperty(java.lang.String name)
null
.
getDynaProperty
in interface DynaClass
name
- Name of the dynamic property for which a descriptor
is requested
java.lang.IllegalArgumentException
- if no property name is specifiedpublic DynaProperty[] getDynaProperties()
Return an array of ProperyDescriptors
for the properties
currently defined in this DynaClass. If no properties are defined, a
zero-length array will be returned.
FIXME - Should we really be implementing
getBeanInfo()
instead, which returns property descriptors
and a bunch of other stuff?
getDynaProperties
in interface DynaClass
public DynaBean newInstance() throws java.lang.IllegalAccessException, java.lang.InstantiationException
Instantiate and return a new DynaBean instance, associated
with this DynaClass. NOTE - This operation is not
supported, and throws an exception. You should create new
WrapDynaBean
instances by calling its constructor:
Object javaBean = ...; DynaBean wrapper = new WrapDynaBean(javaBean);
newInstance
in interface DynaClass
java.lang.IllegalAccessException
- if the Class or the appropriate
constructor is not accessible
java.lang.InstantiationException
- if this Class represents an abstract
class, an array class, a primitive type, or void; or if instantiation
fails for some other reasonpublic java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String name)
null
.
name
- Name of the property to be retrievedpublic static void clear()
public static WrapDynaClass createDynaClass(java.lang.Class beanClass)
WrapDynaClass
instance for the specified bean class.
beanClass
- Bean class for which a WrapDynaClass is requestedprotected void introspect()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |