org.jfree.xml.factory.objects
Interface ObjectDescription

All Known Implementing Classes:
AbstractObjectDescription

public interface ObjectDescription

An interface for object descriptions.

Author:
Thomas Morgner

Method Summary
 void configure(Configuration config)
          Configures this factory.
 java.lang.Object createObject()
          Creates an object based on the description.
 ObjectDescription getInstance()
          Returns a new instance of the object description.
 java.lang.Class getObjectClass()
          Returns the object class.
 java.lang.Object getParameter(java.lang.String name)
          Returns the value of a parameter.
 java.lang.Class getParameterDefinition(java.lang.String name)
          Returns a parameter definition.
 java.util.Iterator getParameterNames()
          Returns an iterator the provides access to the parameter names.
 void setParameter(java.lang.String name, java.lang.Object value)
          Sets the value of a parameter.
 void setParameterFromObject(java.lang.Object o)
          Sets the parameters of this description object to match the supplied object.
 

Method Detail

getParameterDefinition

public java.lang.Class getParameterDefinition(java.lang.String name)
Returns a parameter definition. If the parameter is invalid, this function returns null.

Parameters:
name - the definition name.
Returns:
The parameter class or null, if the parameter is not defined.

setParameter

public void setParameter(java.lang.String name,
                         java.lang.Object value)
Sets the value of a parameter.

Parameters:
name - the parameter name.
value - the parameter value.

getParameter

public java.lang.Object getParameter(java.lang.String name)
Returns the value of a parameter.

Parameters:
name - the parameter name.
Returns:
The value.

getParameterNames

public java.util.Iterator getParameterNames()
Returns an iterator the provides access to the parameter names. This returns all _known_ parameter names, the object description may accept additional parameters.

Returns:
The iterator.

getObjectClass

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

Returns:
The Class.

createObject

public java.lang.Object createObject()
Creates an object based on the description.

Returns:
The object.

getInstance

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

Returns:
The object description.

setParameterFromObject

public void setParameterFromObject(java.lang.Object o)
                            throws ObjectFactoryException
Sets the parameters of this description object to match the supplied object.

Parameters:
o - the object.
Throws:
ObjectFactoryException - if there is a problem while reading the properties of the given object.

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