org.jfree.xml.factory.objects

## Interface ObjectDescription

All Superinterfaces:
  java.io.Serializable

All Known Implementing Classes:
  AbstractObjectDescription, ArrayObjectDescription, BasicStrokeObjectDescription, BeanObjectDescription, BooleanObjectDescription, ByteObjectDescription, CharacterObjectDescription, ClassLoaderObjectDescription, CollectionObjectDescription, ColorObjectDescription, DateObjectDescription, DecimalFormatObjectDescription, Dimension2DObjectDescription, DimensionObjectDescription, DoubleObjectDescription, FloatObjectDescription, IntegerObjectDescription, Line2DObjectDescription, LongObjectDescription, Point2DObjectDescription, Rectangle2DObjectDescription, ShortObjectDescription, SimpleDateFormatObjectDescription, StringObjectDescription, URLObjectDescription

    public interface ObjectDescription
    extends java.io.Serializable

An interface for object descriptions.

Author:
  Thomas Morgner

### Method Summary

Methods
`void` `configure(Configuration config)` Configures this factory.
`java.lang.Object` `createObject()` Creates an object based on the description.
`boolean` `equals(java.lang.Object o)` Compares whether two object descriptions are equal.
`ObjectDescription` `getInstance()` Returns a cloned 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.
`ObjectDescription` `getUnconfiguredInstance()` Returns a cloned instance of the object description.
`int` `hashCode()` Computes the hashCode for this ClassFactory.
`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

    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

    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

    java.lang.Object getParameter(java.lang.String name)

Returns the value of a parameter.

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

#### getParameterNames

    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

    java.lang.Class getObjectClass()

Returns the object class.

Returns:
  The Class.

#### createObject

    java.lang.Object createObject()

Creates an object based on the description.

Returns:
  The object.

#### getUnconfiguredInstance

    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.

#### getInstance

    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.

Returns:
  A cloned instance.

#### setParameterFromObject

    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

    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

#### equals

    boolean equals(java.lang.Object o)

Compares whether two object descriptions are equal.

Overrides:
  `equals` in class `java.lang.Object`
Parameters:
  `o` - the other object.
Returns:
  true, if both object desciptions describe the same object, false otherwise.

#### hashCode

    int hashCode()

Computes the hashCode for this ClassFactory. As equals() must be implemented, a corresponding hashCode() should be implemented as well.

Overrides:
  `hashCode` in class `java.lang.Object`
Returns:
  the hashcode.