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.
handleAttributeDefinition
protected 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.
- handleAttributeDefinition in interface AbstractModelReader
name
- the name of the propertyattribName
- the xml-attribute name to use later.handlerClass
- the attribute handler class.
handleConstructorDefinition
protected void handleConstructorDefinition(String propertyName,
String parameterClass)
Handles a constructor definition. Only one constructor can be defined for
a certain object type. The constructor will be filled using the given properties.
- handleConstructorDefinition in interface AbstractModelReader
propertyName
- the property name of the referenced local propertyparameterClass
- the parameter class for the parameter.
handleElementDefinition
protected 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.
- handleElementDefinition in interface AbstractModelReader
name
- the name of the propertyelement
- the xml-tag name for the child element.
handleLookupDefinition
protected 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.
- handleLookupDefinition in interface AbstractModelReader
name
- the property name of the base objectlookupKey
- the register key of the referenced object
handleManualMapping
protected 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.
- handleManualMapping in interface AbstractModelReader
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 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.
- handleMultiplexMapping in interface AbstractModelReader
typeName
- the type value for this mapping.className
- the class name to which this mapping resolves.
isGenericHandler
public boolean isGenericHandler(Class c)
Checks, whether the factory has a description for the given class.
- isGenericHandler in interface ObjectFactory
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)
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.
- startMultiplexMapping in interface AbstractModelReader
className
- the base class nametypeAttr
- the xml-attribute name containing the mapping key
startObjectDefinition
protected boolean startObjectDefinition(String className,
String register,
boolean ignore)
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.
- startObjectDefinition in interface AbstractModelReader
className
- the class name of the defined objectregister
- the (optional) register name, to lookup and reference the object later.ignore
- ignore?
- true, if the definition was accepted, false otherwise.