Package org.jfree.xml.factory.objects
Class AbstractObjectDescription
- java.lang.Object
-
- org.jfree.xml.factory.objects.AbstractObjectDescription
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,ObjectDescription
- Direct Known Subclasses:
ArrayObjectDescription,BasicStrokeObjectDescription,BeanObjectDescription,BooleanObjectDescription,ByteObjectDescription,CharacterObjectDescription,ClassLoaderObjectDescription,CollectionObjectDescription,ColorObjectDescription,DateObjectDescription,Dimension2DObjectDescription,DimensionObjectDescription,DoubleObjectDescription,FloatObjectDescription,IntegerObjectDescription,Line2DObjectDescription,LongObjectDescription,Point2DObjectDescription,Rectangle2DObjectDescription,ShortObjectDescription,StringObjectDescription,URLObjectDescription
public abstract class AbstractObjectDescription extends java.lang.Object implements ObjectDescription, java.lang.Cloneable
An abstract base class for object descriptions.- Author:
- Thomas Morgner.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractObjectDescription(java.lang.Class className)Creates a new object description.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(Configuration config)Configures this factory.static java.lang.ClassconvertPrimitiveClass(java.lang.Class obj)Converts primitives to corresponding object class.booleanequals(java.lang.Object o)Tests for equality.ConfigurationgetConfig()Returns the configuration for that object description.protected java.util.IteratorgetDefinedParameterNames()Returns an iterator for the parameter names.ObjectDescriptiongetInstance()Returns a cloned instance of the object description.java.lang.ClassgetObjectClass()Returns the class for the object.java.lang.ObjectgetParameter(java.lang.String name)Returns a parameter value.java.lang.ClassgetParameterDefinition(java.lang.String name)Returns a parameter class.java.util.IteratorgetParameterNames()Returns an iterator for the parameter names.ObjectDescriptiongetUnconfiguredInstance()Returns a cloned instance of the object description.inthashCode()Returns a hash code for the object.voidsetParameter(java.lang.String name, java.lang.Object value)Sets a parameter.voidsetParameterDefinition(java.lang.String name, java.lang.Class obj)Sets the class for a parameter.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.xml.factory.objects.ObjectDescription
createObject, setParameterFromObject
-
-
-
-
Constructor Detail
-
AbstractObjectDescription
public AbstractObjectDescription(java.lang.Class className)
Creates a new object description.- Parameters:
className- the class.
-
-
Method Detail
-
getParameterDefinition
public java.lang.Class getParameterDefinition(java.lang.String name)
Returns a parameter class.- Specified by:
getParameterDefinitionin interfaceObjectDescription- Parameters:
name- the parameter definition.- Returns:
- The class.
-
setParameterDefinition
public void setParameterDefinition(java.lang.String name, java.lang.Class obj)
Sets the class for a parameter.- Parameters:
name- the parameter name.obj- the parameter class.
-
convertPrimitiveClass
public static java.lang.Class convertPrimitiveClass(java.lang.Class obj)
Converts primitives to corresponding object class.- Parameters:
obj- the class.- Returns:
- The class.
-
setParameter
public void setParameter(java.lang.String name, java.lang.Object value)
Sets a parameter.- Specified by:
setParameterin interfaceObjectDescription- Parameters:
name- the name.value- the value.
-
getParameterNames
public java.util.Iterator getParameterNames()
Returns an iterator for the parameter names.- Specified by:
getParameterNamesin interfaceObjectDescription- Returns:
- The iterator.
-
getDefinedParameterNames
protected java.util.Iterator getDefinedParameterNames()
Returns an iterator for the parameter names.- Returns:
- The iterator.
-
getParameter
public java.lang.Object getParameter(java.lang.String name)
Returns a parameter value.- Specified by:
getParameterin interfaceObjectDescription- Parameters:
name- the parameter name.- Returns:
- The parameter value.
-
getObjectClass
public java.lang.Class getObjectClass()
Returns the class for the object.- Specified by:
getObjectClassin interfaceObjectDescription- Returns:
- The class.
-
getInstance
public ObjectDescription getInstance()
Returns a cloned instance of the object description. The contents of the parameter objects collection are cloned too, so that any already defined parameter value is copied to the new instance.Parameter definitions are not cloned, as they are considered read-only.
The newly instantiated object description is not configured. If it need to be configured, then you have to call configure on it.
- Specified by:
getInstancein interfaceObjectDescription- Returns:
- A cloned instance.
-
getUnconfiguredInstance
public ObjectDescription getUnconfiguredInstance()
Returns a cloned instance of the object description. The contents of the parameter objects collection are cloned too, so that any already defined parameter value is copied to the new instance.Parameter definitions are not cloned, as they are considered read-only.
The newly instantiated object description is not configured. If it need to be configured, then you have to call configure on it.
- Specified by:
getUnconfiguredInstancein interfaceObjectDescription- Returns:
- A cloned instance.
-
configure
public void configure(Configuration config)
Configures this factory. The configuration contains several keys and their defined values. The given reference to the configuration object will remain valid until the report parsing or writing ends.The configuration contents may change during the reporting.
- Specified by:
configurein interfaceObjectDescription- Parameters:
config- the configuration, never null
-
getConfig
public Configuration getConfig()
Returns the configuration for that object description.- Returns:
- the configuration or null, if not yet set.
-
equals
public boolean equals(java.lang.Object o)
Tests for equality.- Specified by:
equalsin interfaceObjectDescription- Overrides:
equalsin classjava.lang.Object- Parameters:
o- the object to test.- Returns:
- A boolean.
-
hashCode
public int hashCode()
Returns a hash code for the object.- Specified by:
hashCodein interfaceObjectDescription- Overrides:
hashCodein classjava.lang.Object- Returns:
- The hash code.
-
-