Package org.apache.commons.beanutils2
Interface DynaClass
- All Known Subinterfaces:
MutableDynaClass
- All Known Implementing Classes:
BasicDynaClass
,LazyDynaClass
,LazyDynaMap
,ResultSetDynaClass
,RowSetDynaClass
,WrapDynaClass
public interface DynaClass
A DynaClass is a simulation of the functionality of Class
for classes implementing the DynaBean
interface. DynaBean
instances that share the same DynaClass all have the same set of available properties, along with any associated data types, read-only states, and write-only
states.
-
Method Summary
Modifier and TypeMethodDescriptionReturns an array ofPropertyDescriptor
for the properties currently defined in this DynaClass.getDynaProperty
(String name) Returns a property descriptor for the specified property, if it exists; otherwise, returnnull
.getName()
Returns the name of this DynaClass (analogous to thegetName()
method ofClass
, which allows the sameDynaClass
implementation class to support different dynamic classes, with different sets of properties.Instantiates and return a new DynaBean instance, associated with this DynaClass.
-
Method Details
-
getDynaProperties
Returns an array of
PropertyDescriptor
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?- Returns:
- the set of properties for this DynaClass
-
getDynaProperty
Returns a property descriptor for the specified property, if it exists; otherwise, returnnull
.- Parameters:
name
- Name of the dynamic property for which a descriptor is requested- Returns:
- The descriptor for the specified property
- Throws:
IllegalArgumentException
- if no property name is specified
-
getName
Returns the name of this DynaClass (analogous to thegetName()
method ofClass
, which allows the sameDynaClass
implementation class to support different dynamic classes, with different sets of properties.- Returns:
- the name of the DynaClass
-
newInstance
Instantiates and return a new DynaBean instance, associated with this DynaClass.- Returns:
- A new
DynaBean
instance - Throws:
IllegalAccessException
- if the Class or the appropriate constructor is not accessibleInstantiationException
- if this Class represents an abstract class, an array class, a primitive type, or void; or if instantiation fails for some other reason
-