org.jfree.xml.generator
Class DefaultModelReader

java.lang.Object
  extended byorg.jfree.xml.util.AbstractModelReader
      extended byorg.jfree.xml.generator.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()
           
protected  void endMultiplexMapping()
          Finializes the multiplexer 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()
           
protected  void fillSuperClasses()
           
protected  java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String propertyName)
          Returns a property descriptor for the named property, or null if there is no descriptor with the given name.
protected  void handleAttributeDefinition(java.lang.String name, java.lang.String attribName, java.lang.String handlerClass)
          Handles the description of an attribute within an object definition.
protected  void handleConstructorDefinition(java.lang.String tagName, java.lang.String parameterClass)
          Handles a constructor definition.
protected  void handleElementDefinition(java.lang.String name, java.lang.String element)
          Handles the description of an element within an object definition.
protected  void handleIgnoredProperty(java.lang.String name)
          Callback method for ignored properties.
protected  void handleLookupDefinition(java.lang.String name, java.lang.String lookupKey)
          Handles an lookup definition.
protected  boolean handleManualMapping(java.lang.String className, java.lang.String readHandler, java.lang.String writeHandler)
          Handles a manual mapping.
protected  void handleMultiplexMapping(java.lang.String typeName, java.lang.String className)
          Defines an entry for the multiplex mapping.
 DescriptionModel load(java.lang.String file)
           
protected  void startIncludeHandling(java.net.URL resource)
           
protected  void startMultiplexMapping(java.lang.String className, java.lang.String typeAttr)
          Starts a multiplex mapping.
protected  boolean startObjectDefinition(java.lang.String className, java.lang.String register, boolean ignore)
          Begin processing an object definition element.
protected  void startRootDocument()
           
 
Methods inherited from class org.jfree.xml.util.AbstractModelReader
getCloseComment, getOpenComment, loadClass, parseXml, parseXmlDocument, setCloseComment, setOpenComment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultModelReader

public DefaultModelReader()
Creates a new model reader.

Method Detail

load

public DescriptionModel load(java.lang.String file)
                      throws java.io.IOException,
                             ObjectDescriptionException
Throws:
java.io.IOException
ObjectDescriptionException

fillSuperClasses

protected void fillSuperClasses()

startObjectDefinition

protected boolean startObjectDefinition(java.lang.String className,
                                        java.lang.String register,
                                        boolean ignore)
Begin processing an object definition element.

Specified by:
startObjectDefinition in class AbstractModelReader
Parameters:
className - the class name.
register - the register name (null permitted).
ignore - ??
Returns:
true if the class is available, and false otherwise.

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).

Specified by:
endObjectDefinition in class AbstractModelReader
Throws:
ObjectDescriptionException - if an error occures.

handleAttributeDefinition

protected void handleAttributeDefinition(java.lang.String name,
                                         java.lang.String attribName,
                                         java.lang.String handlerClass)
                                  throws ObjectDescriptionException
Handles the description of an attribute within an object definition.

Specified by:
handleAttributeDefinition in class AbstractModelReader
Parameters:
name - the name.
attribName - the attribute name.
handlerClass - the fully qualified class name for the attribute handler.
Throws:
ObjectDescriptionException - if an error occured.

handleConstructorDefinition

protected void handleConstructorDefinition(java.lang.String tagName,
                                           java.lang.String parameterClass)
                                    throws ObjectDescriptionException
Description copied from class: AbstractModelReader
Handles a constructor definition. Only one constructor can be defined for a certain object type. The constructor will be filled using the given properties.

Specified by:
handleConstructorDefinition in class AbstractModelReader
Parameters:
tagName - the property name of the referenced local property
parameterClass - the parameter class for the parameter.
Throws:
ObjectDescriptionException - if an error occured.

handleElementDefinition

protected void handleElementDefinition(java.lang.String name,
                                       java.lang.String element)
                                throws ObjectDescriptionException
Handles the description of an element within an object definition.

Specified by:
handleElementDefinition in class AbstractModelReader
Parameters:
name - the property name.
element - the element name.
Throws:
ObjectDescriptionException - if an error occurs.

handleLookupDefinition

protected void handleLookupDefinition(java.lang.String name,
                                      java.lang.String lookupKey)
                               throws ObjectDescriptionException
Description copied from class: AbstractModelReader
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.

Specified by:
handleLookupDefinition in class AbstractModelReader
Parameters:
name - the property name of the base object
lookupKey - the register key of the referenced object
Throws:
ObjectDescriptionException - if an error occured.

getPropertyDescriptor

protected java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.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.

handleIgnoredProperty

protected void handleIgnoredProperty(java.lang.String name)
Description copied from class: AbstractModelReader
Callback method for ignored properties. Such properties get marked so that the information regarding these properties won't get lost.

Overrides:
handleIgnoredProperty in class AbstractModelReader
Parameters:
name - the name of the ignored property.

handleManualMapping

protected boolean handleManualMapping(java.lang.String className,
                                      java.lang.String readHandler,
                                      java.lang.String writeHandler)
                               throws ObjectDescriptionException
Handles a manual mapping.

Specified by:
handleManualMapping in class AbstractModelReader
Parameters:
className - the class name.
readHandler - the read handler.
writeHandler - the write handler.
Returns:
true, if the mapping was accepted, false otherwise.
Throws:
ObjectDescriptionException - if an unexpected error occured.

startMultiplexMapping

protected void startMultiplexMapping(java.lang.String className,
                                     java.lang.String typeAttr)
Description copied from class: AbstractModelReader
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.

Specified by:
startMultiplexMapping in class AbstractModelReader
Parameters:
className - the base class name
typeAttr - the xml-attribute name containing the mapping key

handleMultiplexMapping

protected void handleMultiplexMapping(java.lang.String typeName,
                                      java.lang.String className)
                               throws ObjectDescriptionException
Description copied from class: AbstractModelReader
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.

Specified by:
handleMultiplexMapping in class AbstractModelReader
Parameters:
typeName - the type value for this mapping.
className - the class name to which this mapping resolves.
Throws:
ObjectDescriptionException - if an error occurs.

endMultiplexMapping

protected void endMultiplexMapping()
                            throws ObjectDescriptionException
Description copied from class: AbstractModelReader
Finializes the multiplexer mapping.

Specified by:
endMultiplexMapping in class AbstractModelReader
Throws:
ObjectDescriptionException - if an error occurs.

startIncludeHandling

protected void startIncludeHandling(java.net.URL resource)
Overrides:
startIncludeHandling in class AbstractModelReader

endIncludeHandling

protected void endIncludeHandling()
Overrides:
endIncludeHandling in class AbstractModelReader

startRootDocument

protected void startRootDocument()
Overrides:
startRootDocument in class AbstractModelReader

endRootDocument

protected void endRootDocument()
Overrides:
endRootDocument in class AbstractModelReader