public final class GenericObjectFactory extends Object
Constructor and Description |
---|
GenericObjectFactory(Class c,
String registerName,
ConstructorDefinition[] constructors,
PropertyDefinition[] propertyDefinitions,
LookupDefinition[] lookupDefinitions,
AttributeDefinition[] attributeDefinitions,
String[] orderedPropertyNames)
Creates a new generic object factory.
|
Modifier and Type | Method and Description |
---|---|
Object |
createObject()
Creates an object according to the definition.
|
AttributeDefinition[] |
getAttributeDefinitions()
Returns the attribute definitions.
|
Class |
getBaseClass()
Returns the base class.
|
ConstructorDefinition[] |
getConstructorDefinitions()
Returns the constructor definitions.
|
GenericObjectFactory |
getInstance()
Returns a copy of this instance.
|
LookupDefinition[] |
getLookupDefinitions()
Returns the lookup definitions.
|
String[] |
getOrderedPropertyNames()
Returns the property names.
|
Object |
getProperty(String name)
Returns the value of the specified property.
|
PropertyDefinition |
getPropertyDefinitionByPropertyName(String propertyName)
Returns the property definition for the specified property name.
|
PropertyDefinition |
getPropertyDefinitionByTagName(String tagName)
Returns a property definition for the specified tag name.
|
PropertyDefinition[] |
getPropertyDefinitions()
Returns the property definitions.
|
String |
getRegisterName()
Returns the register name.
|
Class |
getTypeForTagName(String tagName)
Returns the class for a tag name.
|
boolean |
isPropertyDefinition(String propertyName)
Returns true if there is a property definition for the specified property name.
|
void |
readProperties(Object object)
Reads the properties.
|
void |
setProperty(String propertyName,
Object value)
Sets a property value.
|
void |
writeObjectProperties(Object object)
Writes the properties for the object.
|
public GenericObjectFactory(Class c, String registerName, ConstructorDefinition[] constructors, PropertyDefinition[] propertyDefinitions, LookupDefinition[] lookupDefinitions, AttributeDefinition[] attributeDefinitions, String[] orderedPropertyNames) throws ObjectDescriptionException
c
- the class.registerName
- the (optional) name under which to register the class for
any later lookup.constructors
- the constructor definitions.propertyDefinitions
- the property definitions.lookupDefinitions
- the lookup definitions.attributeDefinitions
- the attribute definitions.orderedPropertyNames
- the ordered property names.ObjectDescriptionException
- if there is a problem.public GenericObjectFactory getInstance()
public String getRegisterName()
public Class getTypeForTagName(String tagName) throws ObjectDescriptionException
tagName
- the tag name.ObjectDescriptionException
- if there is a problem.public boolean isPropertyDefinition(String propertyName)
propertyName
- the property name.public PropertyDefinition getPropertyDefinitionByPropertyName(String propertyName) throws ObjectDescriptionException
propertyName
- the property name.ObjectDescriptionException
- if there is no such property for this object.public PropertyDefinition getPropertyDefinitionByTagName(String tagName) throws ObjectDescriptionException
tagName
- the tag name.ObjectDescriptionException
- if there is no such tag defined for this object.public ConstructorDefinition[] getConstructorDefinitions()
public AttributeDefinition[] getAttributeDefinitions()
public PropertyDefinition[] getPropertyDefinitions()
public String[] getOrderedPropertyNames()
public LookupDefinition[] getLookupDefinitions()
public Object getProperty(String name)
name
- the property name.public Object createObject() throws ObjectDescriptionException
ObjectDescriptionException
- if there is a problem with the object description.public void setProperty(String propertyName, Object value) throws ObjectDescriptionException
propertyName
- the property name.value
- the property value.ObjectDescriptionException
- if there is a problem with the object description.public void writeObjectProperties(Object object) throws ObjectDescriptionException
object
- the object.ObjectDescriptionException
- if there is a problem.public void readProperties(Object object) throws ObjectDescriptionException
object
- the object.ObjectDescriptionException
- if there is a problem.public Class getBaseClass()
Copyright © 2001–2018 JFree.org. All rights reserved.