| java.lang.Object org.jfree.xml.util.AbstractModelReader org.jfree.xml.util.ObjectFactoryLoader
ObjectFactoryLoader | public class ObjectFactoryLoader extends AbstractModelReader implements ObjectFactory(Code) | | The object factory loader loads the xml specification for the generic
handlers. The specification may be distributed over multiple files.
This class provides the model management for the reader and writer.
The instantiation of the handlers is done elsewhere.
author: TM |
Constructor Summary | |
public | ObjectFactoryLoader(URL resourceName) Creates a new object factory loader for the given base file. |
Method Summary | |
protected void | endMultiplexMapping() Finializes the multiplexer mapping. | protected void | endObjectDefinition() Finializes the object definition. | public GenericObjectFactory | getFactoryForClass(Class c) Returns a factory instance for the given class. | public ManualMappingDefinition | getManualMappingDefinition(Class c) Returns the manual mapping definition for the given class, or null, if
not manual definition exists. | public MultiplexMappingDefinition | getMultiplexDefinition(Class c) Returns the multiplex definition for the given class, or null, if no
such definition exists. | protected void | handleAttributeDefinition(String name, String attribName, String handlerClass) Handles an attribute definition. | protected void | handleConstructorDefinition(String propertyName, String parameterClass) Handles a constructor definition. | protected void | handleElementDefinition(String name, String element) Handles an element definition. | protected void | handleLookupDefinition(String name, String lookupKey) Handles an lookup definition. | protected boolean | handleManualMapping(String className, String readHandler, String writeHandler) Handles a manual mapping definition. | protected void | handleMultiplexMapping(String typeName, String className) Defines an entry for the multiplex mapping. | public boolean | isGenericHandler(Class c) Checks, whether the factory has a description for the given class.
Parameters: c - the class to be handled by the factory. | protected void | startMultiplexMapping(String className, String typeAttr) Starts a multiplex mapping. | protected boolean | startObjectDefinition(String className, String register, boolean ignore) Starts a object definition. |
getFactoryForClass | public GenericObjectFactory getFactoryForClass(Class c)(Code) | | Returns a factory instance for the given class. The factory is independent
from all previously generated instances.
Parameters: c - the class the object factory. |
getManualMappingDefinition | public ManualMappingDefinition getManualMappingDefinition(Class c)(Code) | | Returns the manual mapping definition for the given class, or null, if
not manual definition exists.
Parameters: c - the class for which to check the existence of the definition the manual mapping definition or null. |
getMultiplexDefinition | public MultiplexMappingDefinition getMultiplexDefinition(Class c)(Code) | | Returns the multiplex definition for the given class, or null, if no
such definition exists.
Parameters: c - the class for which to check the existence of the multiplexer the multiplexer for the class, or null if no multiplexer exists. |
handleAttributeDefinition | protected void handleAttributeDefinition(String name, String attribName, String handlerClass) throws ObjectDescriptionException(Code) | | Handles an attribute definition. This method gets called after the object definition
was started. The method will be called for every defined attribute property.
Parameters: name - the name of the property Parameters: attribName - the xml-attribute name to use later. Parameters: handlerClass - the attribute handler class. throws: ObjectDescriptionException - if an error occured. |
handleConstructorDefinition | protected void handleConstructorDefinition(String propertyName, String parameterClass)(Code) | | Handles a constructor definition. Only one constructor can be defined for
a certain object type. The constructor will be filled using the given properties.
Parameters: propertyName - the property name of the referenced local property Parameters: parameterClass - the parameter class for the parameter. |
handleElementDefinition | protected void handleElementDefinition(String name, String element) throws ObjectDescriptionException(Code) | | Handles an element definition. This method gets called after the object definition
was started. The method will be called for every defined element property. Element
properties are used to describe complex objects.
Parameters: name - the name of the property Parameters: element - the xml-tag name for the child element. throws: ObjectDescriptionException - if an error occurs. |
handleLookupDefinition | protected void handleLookupDefinition(String name, String lookupKey) throws ObjectDescriptionException(Code) | | Handles an lookup definition. This method gets called after the object definition
was started. The method will be called for every defined lookup property. Lookup properties
reference previously created object using the object's registry name.
Parameters: name - the property name of the base object Parameters: lookupKey - the register key of the referenced object throws: ObjectDescriptionException - if an error occured. |
handleManualMapping | protected boolean handleManualMapping(String className, String readHandler, String writeHandler) throws ObjectDescriptionException(Code) | | Handles a manual mapping definition. The manual mapping maps specific
read and write handlers to a given base class. Manual mappings always
override any other definition.
Parameters: className - the base class name Parameters: readHandler - the class name of the read handler Parameters: writeHandler - the class name of the write handler true, if the mapping was accepted, false otherwise. throws: ObjectDescriptionException - if an unexpected error occured. |
handleMultiplexMapping | protected void handleMultiplexMapping(String typeName, String className) throws ObjectDescriptionException(Code) | | Defines an entry for the multiplex mapping. The new entry will be activated
when the base mappers type attribute contains this typename and
will resolve to the handler for the given classname.
Parameters: typeName - the type value for this mapping. Parameters: className - the class name to which this mapping resolves. throws: ObjectDescriptionException - if an error occurs. |
isGenericHandler | public boolean isGenericHandler(Class c)(Code) | | Checks, whether the factory has a description for the given class.
Parameters: c - the class to be handled by the factory. true, if an description exists for the given class, false otherwise. |
startMultiplexMapping | protected void startMultiplexMapping(String className, String typeAttr)(Code) | | Starts a multiplex mapping. Multiplex mappings are used to define polymorphic
argument handlers. The mapper will collect all derived classes of the given
base class and will select the corresponding mapping based on the given type
attribute.
Parameters: className - the base class name Parameters: typeAttr - the xml-attribute name containing the mapping key |
startObjectDefinition | protected boolean startObjectDefinition(String className, String register, boolean ignore) throws ObjectDescriptionException(Code) | | Starts a object definition. The object definition collects all properties of
an bean-class and defines, which constructor should be used when creating the
class.
Parameters: className - the class name of the defined object Parameters: register - the (optional) register name, to lookup and reference the object later. Parameters: ignore - ignore? true, if the definition was accepted, false otherwise. throws: ObjectDescriptionException - if an unexpected error occured. |
Methods inherited from org.jfree.xml.util.AbstractModelReader | protected void endIncludeHandling()(Code)(Java Doc) abstract protected void endMultiplexMapping() throws ObjectDescriptionException(Code)(Java Doc) abstract protected void endObjectDefinition() throws ObjectDescriptionException(Code)(Java Doc) protected void endRootDocument()(Code)(Java Doc) protected String[] getCloseComment()(Code)(Java Doc) protected CommentHandler getCommentHandler()(Code)(Java Doc) protected String[] getOpenComment()(Code)(Java Doc) abstract protected void handleAttributeDefinition(String name, String attribName, String handlerClass) throws ObjectDescriptionException(Code)(Java Doc) abstract protected void handleConstructorDefinition(String propertyName, String parameterClass) throws ObjectDescriptionException(Code)(Java Doc) abstract protected void handleElementDefinition(String name, String element) throws ObjectDescriptionException(Code)(Java Doc) protected void handleIgnoredProperty(String name)(Code)(Java Doc) abstract protected void handleLookupDefinition(String name, String lookupKey) throws ObjectDescriptionException(Code)(Java Doc) abstract protected boolean handleManualMapping(String className, String readHandler, String writeHandler) throws ObjectDescriptionException(Code)(Java Doc) abstract protected void handleMultiplexMapping(String typeName, String className) throws ObjectDescriptionException(Code)(Java Doc) protected Class loadClass(String className)(Code)(Java Doc) protected void parseXml(URL resource) throws ObjectDescriptionException(Code)(Java Doc) protected void parseXmlDocument(URL resource, boolean isInclude) throws ObjectDescriptionException(Code)(Java Doc) protected void setCloseComment(String[] closeComment)(Code)(Java Doc) protected void setOpenComment(String[] openComment)(Code)(Java Doc) protected void startIncludeHandling(URL resource)(Code)(Java Doc) abstract protected void startMultiplexMapping(String className, String typeAttr)(Code)(Java Doc) abstract protected boolean startObjectDefinition(String className, String register, boolean ignored) throws ObjectDescriptionException(Code)(Java Doc) protected void startRootDocument()(Code)(Java Doc)
|
|
|