|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.oddjob.values.types.PropertyTypeDynaClass
public class PropertyTypeDynaClass
A DynaClass for the PropertyType which always returns
PropertyType as the type
for all properties.
org.apche.commons.beanutils.LazyDynaBean,
Serialized Form| Constructor Summary | |
|---|---|
PropertyTypeDynaClass(String name)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
add(org.apache.commons.beanutils.DynaProperty property)
Add a new dynamic property. |
void |
add(String name)
|
void |
add(String name,
Class type)
Add a new dynamic property with the specified data type, but with no restrictions on readability or writeability. |
void |
add(String name,
Class type,
boolean readable,
boolean writeable)
Add a new dynamic property with the specified data type, readability, and writeability. |
org.apache.commons.beanutils.DynaProperty[] |
getDynaProperties()
|
org.apache.commons.beanutils.DynaProperty |
getDynaProperty(String name)
Return a property descriptor for the specified property. |
String |
getName()
|
boolean |
isRestricted()
This MutableDynaClass is never restricted. |
org.apache.commons.beanutils.DynaBean |
newInstance()
|
void |
remove(String name)
Remove the specified dynamic property, and any associated data type, readability, and writeability, from this dynamic class. |
void |
setRestricted(boolean restricted)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PropertyTypeDynaClass(String name)
name - The name.| Method Detail |
|---|
public boolean isRestricted()
isRestricted in interface org.apache.commons.beanutils.MutableDynaClassMutableDynaClass.isRestricted()public void setRestricted(boolean restricted)
setRestricted in interface org.apache.commons.beanutils.MutableDynaClasspublic void add(String name)
add in interface org.apache.commons.beanutils.MutableDynaClass
public void add(String name,
Class type)
add in interface org.apache.commons.beanutils.MutableDynaClassname - Name of the new dynamic propertytype - Data type of the new dynamic property (null for no
restrictions)
IllegalArgumentException - if name is null
IllegalStateException - if this DynaClass is currently
restricted, so no new properties can be added
public void add(String name,
Class type,
boolean readable,
boolean writeable)
Add a new dynamic property with the specified data type, readability, and writeability.
N.B.Support for readable/writeable properties has not been implemented
and this method always throws a UnsupportedOperationException.
I'm not sure the intention of the original authors for this method, but it seems to
me that readable/writable should be attributes of the DynaProperty class
(which they are not) and is the reason this method has not been implemented.
add in interface org.apache.commons.beanutils.MutableDynaClassname - Name of the new dynamic propertytype - Data type of the new dynamic property (null for no
restrictions)readable - Set to true if this property value
should be readablewriteable - Set to true if this property value
should be writeable
UnsupportedOperationException - anytime this method is calledprotected void add(org.apache.commons.beanutils.DynaProperty property)
property - Property the new dynamic property to add.
IllegalArgumentException - if name is null
IllegalStateException - if this DynaClass is currently
restricted, so no new properties can be addedpublic void remove(String name)
remove in interface org.apache.commons.beanutils.MutableDynaClassname - Name of the dynamic property to remove
IllegalArgumentException - if name is null
IllegalStateException - if this DynaClass is currently
restricted, so no properties can be removedpublic org.apache.commons.beanutils.DynaProperty getDynaProperty(String name)
Return a property descriptor for the specified property.
If the property is not found and the returnNull indicator is
true, this method always returns null.
If the property is not found and the returnNull indicator is
false a new property descriptor is created and returned (although
its not actually added to the DynaClass's properties). This is the default
beahviour.
The reason for not returning a null property descriptor is that
BeanUtils uses this method to check if a property exists
before trying to set it - since these Lazy implementations automatically
add any new properties when they are set, returning null from
this method would defeat their purpose.
getDynaProperty in interface org.apache.commons.beanutils.DynaClassname - Name of the dynamic property for which a descriptor
is requested
IllegalArgumentException - if no property name is specifiedpublic org.apache.commons.beanutils.DynaProperty[] getDynaProperties()
getDynaProperties in interface org.apache.commons.beanutils.DynaClasspublic String getName()
getName in interface org.apache.commons.beanutils.DynaClass
public org.apache.commons.beanutils.DynaBean newInstance()
throws IllegalAccessException,
InstantiationException
newInstance in interface org.apache.commons.beanutils.DynaClassIllegalAccessException
InstantiationException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||