Loads the class model from an previously written xml file set.
This class provides abstract methods which get called during the parsing
(similiar to the SAX parsing, but slightly easier to code).
This will need a rewrite in the future, when the structure is finished.
getCloseComment
protected String[] getCloseComment()
Returns the close comment.
getOpenComment
protected String[] getOpenComment()
Returns the open comment.
handleAttributeDefinition
protected abstract void handleAttributeDefinition(String name,
String attribName,
String handlerClass)
throws ObjectDescriptionException
Handles an attribute definition. This method gets called after the object definition
was started. The method will be called for every defined attribute property.
name
- the name of the propertyattribName
- the xml-attribute name to use later.handlerClass
- the attribute handler class.
handleConstructorDefinition
protected abstract void handleConstructorDefinition(String propertyName,
String parameterClass)
throws ObjectDescriptionException
Handles a constructor definition. Only one constructor can be defined for
a certain object type. The constructor will be filled using the given properties.
propertyName
- the property name of the referenced local propertyparameterClass
- the parameter class for the parameter.
handleElementDefinition
protected abstract void handleElementDefinition(String name,
String element)
throws ObjectDescriptionException
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.
name
- the name of the propertyelement
- the xml-tag name for the child element.
handleIgnoredProperty
protected void handleIgnoredProperty(String name)
Callback method for ignored properties. Such properties get marked so that
the information regarding these properties won't get lost.
name
- the name of the ignored property.
handleLookupDefinition
protected abstract void handleLookupDefinition(String name,
String lookupKey)
throws ObjectDescriptionException
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.
name
- the property name of the base objectlookupKey
- the register key of the referenced object
handleManualMapping
protected abstract boolean handleManualMapping(String className,
String readHandler,
String writeHandler)
throws ObjectDescriptionException
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.
className
- the base class namereadHandler
- the class name of the read handlerwriteHandler
- the class name of the write handler
- true, if the mapping was accepted, false otherwise.
handleMultiplexMapping
protected abstract void handleMultiplexMapping(String typeName,
String className)
throws ObjectDescriptionException
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.
typeName
- the type value for this mapping.className
- the class name to which this mapping resolves.
loadClass
protected Class loadClass(String className)
Loads the given class, and ignores all exceptions which may occur
during the loading. If the class was invalid, null is returned instead.
className
- the name of the class to be loaded.
parseXmlDocument
protected void parseXmlDocument(URL resource,
boolean isInclude)
throws ObjectDescriptionException
Parses the given specification and loads all includes specified in the files.
This implementation does not check for loops in the include files.
resource
- the url of the xml specification.isInclude
- an include?
setCloseComment
protected void setCloseComment(String[] closeComment)
Sets the close comment.
closeComment
- the close comment.
setOpenComment
protected void setOpenComment(String[] openComment)
Sets the open comment.
openComment
- the open comment.
startMultiplexMapping
protected abstract void startMultiplexMapping(String className,
String typeAttr)
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.
className
- the base class nametypeAttr
- the xml-attribute name containing the mapping key
startObjectDefinition
protected abstract boolean startObjectDefinition(String className,
String register,
boolean ignored)
throws ObjectDescriptionException
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.
className
- the class name of the defined objectregister
- the (optional) register name, to lookup and reference the object
later.ignored
- ??.
- true, if the definition was accepted, false otherwise.