org.jfree.xml.factory.objects

Class CollectionObjectDescription

Implemented Interfaces:
Cloneable, ObjectDescription, Serializable

public class CollectionObjectDescription
extends AbstractObjectDescription

An object description for simple collection objects, like java.util.List or java.util.Set.
Author:
Thomas Morgner

Constructor Summary

CollectionObjectDescription(Class c)
Creates a list object description for the given collection class.

Method Summary

Object
createObject()
Creates an object based on the description.
Class
getParameterDefinition(String name)
Returns a parameter definition.
Iterator
getParameterNames()
Returns an iterator for the parameter names.
void
setParameterFromObject(Object o)
Sets the parameters of this description object to match the supplied object.

Methods inherited from class org.jfree.xml.factory.objects.AbstractObjectDescription

configure, convertPrimitiveClass, equals, getConfig, getDefinedParameterNames, getInstance, getObjectClass, getParameter, getParameterDefinition, getParameterNames, getUnconfiguredInstance, hashCode, setParameter, setParameterDefinition

Constructor Details

CollectionObjectDescription

public CollectionObjectDescription(Class c)
Creates a list object description for the given collection class.

Throws ClassCastException if the given class is no collection instance.

Parameters:
c - the class of the collection implementation.

Method Details

createObject

public Object createObject()
Creates an object based on the description.
Specified by:
createObject in interface ObjectDescription
Returns:
The object.

getParameterDefinition

public Class getParameterDefinition(String name)
Returns a parameter definition. If the parameter is invalid, this function returns null.
Specified by:
getParameterDefinition in interface ObjectDescription
Overrides:
getParameterDefinition in interface AbstractObjectDescription
Parameters:
name - the definition name.
Returns:
The parameter class or null, if the parameter is not defined.

getParameterNames

public Iterator getParameterNames()
Returns an iterator for the parameter names.
Specified by:
getParameterNames in interface ObjectDescription
Overrides:
getParameterNames in interface AbstractObjectDescription
Returns:
The iterator.

setParameterFromObject

public void setParameterFromObject(Object o)
            throws ObjectFactoryException
Sets the parameters of this description object to match the supplied object.
Specified by:
setParameterFromObject in interface ObjectDescription
Parameters:
o - the object.
Throws:
ObjectFactoryException - if there is a problem while reading the properties of the given object.