org.jfree.xml.factory.objects
Class AbstractObjectDescription

java.lang.Object
  extended byorg.jfree.xml.factory.objects.AbstractObjectDescription
All Implemented Interfaces:
java.lang.Cloneable, ObjectDescription
Direct Known Subclasses:
ArrayObjectDescription, BasicStrokeObjectDescription, BeanObjectDescription, BooleanObjectDescription, ByteObjectDescription, CharacterObjectDescription, ClassLoaderObjectDescription, CollectionObjectDescription, ColorObjectDescription, DateObjectDescription, 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.

Constructor Summary
AbstractObjectDescription(java.lang.Class className)
          Creates a new object description.
 
Method Summary
 void configure(Configuration config)
          Configures this factory.
static java.lang.Class convertPrimitiveClass(java.lang.Class obj)
          Converts primitives to corresponding object class.
 Configuration getConfig()
          Returns the configuration for that object description.
protected  java.util.Iterator getDefinedParameterNames()
          Returns an iterator for the parameter names.
 ObjectDescription getInstance()
          Returns a cloned instance of the object description.
 java.lang.Class getObjectClass()
          Returns the class for the object.
 java.lang.Object getParameter(java.lang.String name)
          Returns a parameter value.
 java.lang.Class getParameterDefinition(java.lang.String name)
          Returns a parameter class.
 java.util.Iterator getParameterNames()
          Returns an iterator for the parameter names.
 void setParameter(java.lang.String name, java.lang.Object value)
          Sets a parameter.
 void setParameterDefinition(java.lang.String name, java.lang.Class obj)
          Sets the class for a parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, 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:
getParameterDefinition in interface ObjectDescription
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:
setParameter in interface ObjectDescription
Parameters:
name - the name.
value - the value.

getParameterNames

public java.util.Iterator getParameterNames()
Returns an iterator for the parameter names.

Specified by:
getParameterNames in interface ObjectDescription
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:
getParameter in interface ObjectDescription
Parameters:
name - the parameter name.
Returns:
The parameter value.

getObjectClass

public java.lang.Class getObjectClass()
Returns the class for the object.

Specified by:
getObjectClass in interface ObjectDescription
Returns:
The class.

getInstance

public ObjectDescription getInstance()
Returns a cloned instance of the object description.

Specified by:
getInstance in interface ObjectDescription
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:
configure in interface ObjectDescription
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.