org.jfree.xml.factory.objects

Class AbstractObjectDescription

public abstract class AbstractObjectDescription extends Object implements ObjectDescription, Cloneable

An abstract base class for object descriptions.

Author: Thomas Morgner.

Constructor Summary
AbstractObjectDescription(Class className)
Creates a new object description.
Method Summary
voidconfigure(Configuration config)
Configures this factory.
static ClassconvertPrimitiveClass(Class obj)
Converts primitives to corresponding object class.
booleanequals(Object o)
Tests for equality.
ConfigurationgetConfig()
Returns the configuration for that object description.
protected IteratorgetDefinedParameterNames()
Returns an iterator for the parameter names.
ObjectDescriptiongetInstance()
Returns a cloned instance of the object description.
ClassgetObjectClass()
Returns the class for the object.
ObjectgetParameter(String name)
Returns a parameter value.
ClassgetParameterDefinition(String name)
Returns a parameter class.
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(String name, Object value)
Sets a parameter.
voidsetParameterDefinition(String name, Class obj)
Sets the class for a parameter.

Constructor Detail

AbstractObjectDescription

public AbstractObjectDescription(Class className)
Creates a new object description.

Parameters: className the class.

Method Detail

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.

Parameters: config the configuration, never null

convertPrimitiveClass

public static Class convertPrimitiveClass(Class obj)
Converts primitives to corresponding object class.

Parameters: obj the class.

Returns: The class.

equals

public boolean equals(Object o)
Tests for equality.

Parameters: o the object to test.

Returns: A boolean.

getConfig

public Configuration getConfig()
Returns the configuration for that object description.

Returns: the configuration or null, if not yet set.

getDefinedParameterNames

protected Iterator getDefinedParameterNames()
Returns an iterator for the parameter names.

Returns: The iterator.

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.

Returns: A cloned instance.

getObjectClass

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

Returns: The class.

getParameter

public Object getParameter(String name)
Returns a parameter value.

Parameters: name the parameter name.

Returns: The parameter value.

getParameterDefinition

public Class getParameterDefinition(String name)
Returns a parameter class.

Parameters: name the parameter definition.

Returns: The class.

getParameterNames

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

Returns: The iterator.

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.

Returns: A cloned instance.

hashCode

public int hashCode()
Returns a hash code for the object.

Returns: The hash code.

setParameter

public void setParameter(String name, Object value)
Sets a parameter.

Parameters: name the name. value the value.

setParameterDefinition

public void setParameterDefinition(String name, Class obj)
Sets the class for a parameter.

Parameters: name the parameter name. obj the parameter class.