Package org.jfree.xml.factory.objects
Class BeanObjectDescription
- java.lang.Object
-
- org.jfree.xml.factory.objects.AbstractObjectDescription
-
- org.jfree.xml.factory.objects.BeanObjectDescription
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,ObjectDescription
- Direct Known Subclasses:
DecimalFormatObjectDescription,SimpleDateFormatObjectDescription
public class BeanObjectDescription extends AbstractObjectDescription
An object-description for a bean object. This object description is very dangerous, if the bean contains properties with undefined types.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.TreeSetignoredParametersprivate java.util.HashMapproperties
-
Constructor Summary
Constructors Constructor Description BeanObjectDescription(java.lang.Class className)Creates a new object description.BeanObjectDescription(java.lang.Class className, boolean init)Creates a new object description.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectcreateObject()Creates an object based on this description.private java.lang.reflect.MethodfindGetMethod(java.lang.String parameterName)Finds a get method in the bean.private java.lang.reflect.MethodfindSetMethod(java.lang.String parameterName)Finds a set method in the bean.protected voidignoreParameter(java.lang.String parameter)Adds a parameter to the ignored parameters.protected booleanisParameterIgnored(java.lang.String parameter)Returns a flag that indicates whether or not the specified parameter is ignored.private booleanisValidMethod(java.lang.reflect.Method method, int parCount)private voidreadBeanDescription(java.lang.Class className, boolean init)private voidreadObject(java.io.ObjectInputStream in)voidsetParameterFromObject(java.lang.Object o)Sets the parameters in the description to match the supplied object.-
Methods inherited from class org.jfree.xml.factory.objects.AbstractObjectDescription
configure, convertPrimitiveClass, equals, getConfig, getDefinedParameterNames, getInstance, getObjectClass, getParameter, getParameterDefinition, getParameterNames, getUnconfiguredInstance, hashCode, setParameter, setParameterDefinition
-
-
-
-
Constructor Detail
-
BeanObjectDescription
public BeanObjectDescription(java.lang.Class className)
Creates a new object description.- Parameters:
className- the class.
-
BeanObjectDescription
public BeanObjectDescription(java.lang.Class className, boolean init)Creates a new object description.- Parameters:
className- the class.init- set to true, to autmaoticly initialise the object description. If set to false, the initialisation is elsewhere.
-
-
Method Detail
-
isValidMethod
private boolean isValidMethod(java.lang.reflect.Method method, int parCount)
-
createObject
public java.lang.Object createObject()
Creates an object based on this description.- Returns:
- The object.
-
findSetMethod
private java.lang.reflect.Method findSetMethod(java.lang.String parameterName)
Finds a set method in the bean.- Parameters:
parameterName- the parameter name.- Returns:
- The method.
-
findGetMethod
private java.lang.reflect.Method findGetMethod(java.lang.String parameterName)
Finds a get method in the bean.- Parameters:
parameterName- the paramater name.- Returns:
- The method.
-
setParameterFromObject
public void setParameterFromObject(java.lang.Object o) throws ObjectFactoryExceptionSets the parameters in the description to match the supplied object.- Parameters:
o- the object (nullnot allowed).- Throws:
ObjectFactoryException- if there is a problem.
-
ignoreParameter
protected void ignoreParameter(java.lang.String parameter)
Adds a parameter to the ignored parameters.- Parameters:
parameter- the parameter.
-
isParameterIgnored
protected boolean isParameterIgnored(java.lang.String parameter)
Returns a flag that indicates whether or not the specified parameter is ignored.- Parameters:
parameter- the parameter.- Returns:
- The flag.
-
readObject
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
readBeanDescription
private void readBeanDescription(java.lang.Class className, boolean init)
-
-