org.jfree.xml.generator

Class DefaultModelReader


public class DefaultModelReader
extends AbstractModelReader

A reader for the class model.

Constructor Summary

DefaultModelReader()
Creates a new model reader.

Method Summary

protected void
endIncludeHandling()
Ends include handling.
protected void
endMultiplexMapping()
Ends a multiplex mapping.
protected void
endObjectDefinition()
Finishes processing an object definition (sets the constructor and property info for the class description, and adds the class description to the model).
protected void
endRootDocument()
Ends the root document.
protected void
fillSuperClasses()
Iterates through all the class descriptions in the model, setting the superclass attribute in all cases where the superclass definitions are contained in the model.
protected PropertyDescriptor
getPropertyDescriptor(String propertyName)
Returns a property descriptor for the named property, or null if there is no descriptor with the given name.
protected void
handleAttributeDefinition(String name, String attribName, String handlerClass)
Handles the description of an attribute within an object definition.
protected void
handleConstructorDefinition(String tagName, String parameterClass)
Handles the constructor definition.
protected void
handleElementDefinition(String name, String element)
Handles the description of an element within an object definition.
protected void
handleIgnoredProperty(String name)
Handles an ignored property.
protected void
handleLookupDefinition(String name, String lookupKey)
Handles a lookup definition.
protected boolean
handleManualMapping(String className, String readHandler, String writeHandler)
Handles a manual mapping.
protected void
handleMultiplexMapping(String typeName, String className)
Handles a multiplex mapping.
DescriptionModel
load(String file)
Loads a description model.
protected void
startIncludeHandling(URL resource)
Starts include handling.
protected void
startMultiplexMapping(String className, String typeAttr)
Start a multiplex mapping.
protected boolean
startObjectDefinition(String className, String register, boolean ignore)
Begin processing an object definition element.
protected void
startRootDocument()
Starts the root document.

Methods inherited from class org.jfree.xml.util.AbstractModelReader

endIncludeHandling, endMultiplexMapping, endObjectDefinition, endRootDocument, getCloseComment, getCommentHandler, getOpenComment, handleAttributeDefinition, handleConstructorDefinition, handleElementDefinition, handleIgnoredProperty, handleLookupDefinition, handleManualMapping, handleMultiplexMapping, loadClass, parseXml, parseXmlDocument, setCloseComment, setOpenComment, startIncludeHandling, startMultiplexMapping, startObjectDefinition, startRootDocument

Constructor Details

DefaultModelReader

public DefaultModelReader()
Creates a new model reader.

Method Details

endIncludeHandling

protected void endIncludeHandling()
Ends include handling.
Overrides:
endIncludeHandling in interface AbstractModelReader

endMultiplexMapping

protected void endMultiplexMapping()
            throws ObjectDescriptionException
Ends a multiplex mapping.
Overrides:
endMultiplexMapping in interface AbstractModelReader
Throws:
ObjectDescriptionException - if there is a problem with the object description.

endObjectDefinition

protected void endObjectDefinition()
            throws ObjectDescriptionException
Finishes processing an object definition (sets the constructor and property info for the class description, and adds the class description to the model).
Overrides:
endObjectDefinition in interface AbstractModelReader
Throws:
ObjectDescriptionException - if there is a problem with the object description.

endRootDocument

protected void endRootDocument()
Ends the root document.
Overrides:
endRootDocument in interface AbstractModelReader

fillSuperClasses

protected void fillSuperClasses()
Iterates through all the class descriptions in the model, setting the superclass attribute in all cases where the superclass definitions are contained in the model.

getPropertyDescriptor

protected PropertyDescriptor getPropertyDescriptor(String propertyName)
Returns a property descriptor for the named property, or null if there is no descriptor with the given name.
Parameters:
propertyName - the property name.
Returns:
a property descriptor.

handleAttributeDefinition

protected void handleAttributeDefinition(String name,
                                         String attribName,
                                         String handlerClass)
            throws ObjectDescriptionException
Handles the description of an attribute within an object definition.
Overrides:
handleAttributeDefinition in interface AbstractModelReader
Parameters:
name - the name.
attribName - the attribute name.
handlerClass - the fully qualified class name for the attribute handler.
Throws:
ObjectDescriptionException - if there is a problem with the object description.

handleConstructorDefinition

protected void handleConstructorDefinition(String tagName,
                                           String parameterClass)
            throws ObjectDescriptionException
Handles the constructor definition.
Overrides:
handleConstructorDefinition in interface AbstractModelReader
Parameters:
tagName - the tag name.
parameterClass - the parameter class.
Throws:
ObjectDescriptionException - if there is a problem with the object description.

handleElementDefinition

protected void handleElementDefinition(String name,
                                       String element)
            throws ObjectDescriptionException
Handles the description of an element within an object definition.
Overrides:
handleElementDefinition in interface AbstractModelReader
Parameters:
name - the property name.
element - the element name.
Throws:
ObjectDescriptionException - if there is a problem with the object description.

handleIgnoredProperty

protected void handleIgnoredProperty(String name)
Handles an ignored property.
Overrides:
handleIgnoredProperty in interface AbstractModelReader
Parameters:
name - the name.

handleLookupDefinition

protected void handleLookupDefinition(String name,
                                      String lookupKey)
            throws ObjectDescriptionException
Handles a lookup definition.
Overrides:
handleLookupDefinition in interface AbstractModelReader
Parameters:
name - the name.
lookupKey - the lookup key.
Throws:
ObjectDescriptionException - if there is a problem with the object description.

handleManualMapping

protected boolean handleManualMapping(String className,
                                      String readHandler,
                                      String writeHandler)
            throws ObjectDescriptionException
Handles a manual mapping.
Overrides:
handleManualMapping in interface AbstractModelReader
Parameters:
className - the class name.
readHandler - the read handler.
writeHandler - the write handler.
Returns:
A boolean.
Throws:
ObjectDescriptionException - if there is a problem with the object description.

handleMultiplexMapping

protected void handleMultiplexMapping(String typeName,
                                      String className)
            throws ObjectDescriptionException
Handles a multiplex mapping.
Overrides:
handleMultiplexMapping in interface AbstractModelReader
Parameters:
typeName - the type name.
className - the class name.
Throws:
ObjectDescriptionException - if there is a problem with the object description.

load

public DescriptionModel load(String file)
            throws IOException,
                   ObjectDescriptionException
Loads a description model.
Parameters:
file - the file name.
Returns:
A description model.
Throws:
ObjectDescriptionException - if there is a problem reading the object descriptions.

startIncludeHandling

protected void startIncludeHandling(URL resource)
Starts include handling.
Overrides:
startIncludeHandling in interface AbstractModelReader
Parameters:
resource - the URL.

startMultiplexMapping

protected void startMultiplexMapping(String className,
                                     String typeAttr)
Start a multiplex mapping.
Overrides:
startMultiplexMapping in interface AbstractModelReader
Parameters:
className - the class name.
typeAttr - the type.

startObjectDefinition

protected boolean startObjectDefinition(String className,
                                        String register,
                                        boolean ignore)
Begin processing an object definition element.
Overrides:
startObjectDefinition in interface AbstractModelReader
Parameters:
className - the class name.
register - the register name (null permitted).
ignore - ??
Returns:
true if the class is available, and false otherwise.

startRootDocument

protected void startRootDocument()
Starts the root document.
Overrides:
startRootDocument in interface AbstractModelReader