Package org.jfree.xml.generator
Class DefaultModelReader
java.lang.Object
org.jfree.xml.util.AbstractModelReader
org.jfree.xml.generator.DefaultModelReader
A reader for the class model.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate URL
The base URL.private ArrayList
Storage for the constructors of the current class.private BeanInfo
Information about the class being processed.private ClassDescription
The class description under construction.private DescriptionModel
A model containing classes and the corresponding class descriptions.private MultiplexMappingInfo
The multiplex mapping info.private ArrayList
The multiplex type info.private ArrayList
Storage for the properties of the current class.private String
The source. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Ends include handling.protected void
Ends a multiplex mapping.protected void
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
Ends the root document.protected void
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, ornull
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.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
Starts the root document.Methods inherited from class org.jfree.xml.util.AbstractModelReader
getCloseComment, getCommentHandler, getOpenComment, loadClass, parseXml, parseXmlDocument, setCloseComment, setOpenComment
-
Field Details
-
model
A model containing classes and the corresponding class descriptions. -
currentClassDescription
The class description under construction. -
currentBeanInfo
Information about the class being processed. -
baseURL
The base URL. -
source
The source. -
multiplexInfo
The multiplex mapping info. -
multiplexTypeInfos
The multiplex type info. -
propertyList
Storage for the properties of the current class. -
constructorList
Storage for the constructors of the current class.
-
-
Constructor Details
-
DefaultModelReader
public DefaultModelReader()Creates a new model reader.
-
-
Method Details
-
load
Loads a description model.- Parameters:
file
- the file name.- Returns:
- A description model.
- Throws:
IOException
- if there is an I/O problem.ObjectDescriptionException
- if there is a problem reading the object descriptions.
-
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. -
startObjectDefinition
Begin processing an object definition element.- Specified by:
startObjectDefinition
in classAbstractModelReader
- Parameters:
className
- the class name.register
- the register name (null
permitted).ignore
- ??- Returns:
true
if the class is available, andfalse
otherwise.
-
endObjectDefinition
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 classAbstractModelReader
- Throws:
ObjectDescriptionException
- if there is a problem with the object description.
-
handleAttributeDefinition
protected void handleAttributeDefinition(String name, String attribName, String handlerClass) throws ObjectDescriptionException Handles the description of an attribute within an object definition.- Specified by:
handleAttributeDefinition
in classAbstractModelReader
- 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.- Specified by:
handleConstructorDefinition
in classAbstractModelReader
- 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.- Specified by:
handleElementDefinition
in classAbstractModelReader
- Parameters:
name
- the property name.element
- the element name.- Throws:
ObjectDescriptionException
- if there is a problem with the object description.
-
handleLookupDefinition
protected void handleLookupDefinition(String name, String lookupKey) throws ObjectDescriptionException Handles a lookup definition.- Specified by:
handleLookupDefinition
in classAbstractModelReader
- Parameters:
name
- the name.lookupKey
- the lookup key.- Throws:
ObjectDescriptionException
- if there is a problem with the object description.
-
getPropertyDescriptor
Returns a property descriptor for the named property, ornull
if there is no descriptor with the given name.- Parameters:
propertyName
- the property name.- Returns:
- a property descriptor.
-
handleIgnoredProperty
Handles an ignored property.- Overrides:
handleIgnoredProperty
in classAbstractModelReader
- Parameters:
name
- the name.
-
handleManualMapping
protected boolean handleManualMapping(String className, String readHandler, String writeHandler) throws ObjectDescriptionException Handles a manual mapping.- Specified by:
handleManualMapping
in classAbstractModelReader
- 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.
-
startMultiplexMapping
Start a multiplex mapping.- Specified by:
startMultiplexMapping
in classAbstractModelReader
- Parameters:
className
- the class name.typeAttr
- the type.
-
handleMultiplexMapping
protected void handleMultiplexMapping(String typeName, String className) throws ObjectDescriptionException Handles a multiplex mapping.- Specified by:
handleMultiplexMapping
in classAbstractModelReader
- Parameters:
typeName
- the type name.className
- the class name.- Throws:
ObjectDescriptionException
- if there is a problem with the object description.
-
endMultiplexMapping
Ends a multiplex mapping.- Specified by:
endMultiplexMapping
in classAbstractModelReader
- Throws:
ObjectDescriptionException
- if there is a problem with the object description.
-
startIncludeHandling
Starts include handling.- Overrides:
startIncludeHandling
in classAbstractModelReader
- Parameters:
resource
- the URL.
-
endIncludeHandling
protected void endIncludeHandling()Ends include handling.- Overrides:
endIncludeHandling
in classAbstractModelReader
-
startRootDocument
protected void startRootDocument()Starts the root document.- Overrides:
startRootDocument
in classAbstractModelReader
-
endRootDocument
protected void endRootDocument()Ends the root document.- Overrides:
endRootDocument
in classAbstractModelReader
-