public abstract class RootXmlWriteHandler extends java.lang.Object
Constructor and Description |
---|
RootXmlWriteHandler()
Creates a new RootXmlWrite handler with the default mappings enabled.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addManualMapping(java.lang.Class classToWrite,
java.lang.Class handler)
Adds a new manual mapping to this handler.
|
protected void |
addMultiplexMapping(java.lang.Class baseClass,
java.lang.String typeAttr,
MultiplexMappingEntry[] mdef)
Adds a multiplex mapping.
|
protected abstract ObjectFactory |
getFactoryLoader()
Returns the object factory.
|
protected XmlWriteHandler |
getMapping(java.lang.Class classToWrite)
Tries to find the mapping for the given class.
|
protected XmlWriteHandler |
loadHandlerClass(java.lang.String className)
Loads the given class, and ignores all exceptions which may occur
during the loading.
|
void |
write(java.lang.String tagName,
java.lang.Object object,
java.lang.Class baseClass,
XMLWriter writer)
Writes the given object with the specified tagname.
|
public RootXmlWriteHandler()
protected abstract ObjectFactory getFactoryLoader()
protected void addManualMapping(java.lang.Class classToWrite, java.lang.Class handler)
classToWrite
- the class, which should be handledhandler
- the write handler implementation for that class.protected void addMultiplexMapping(java.lang.Class baseClass, java.lang.String typeAttr, MultiplexMappingEntry[] mdef)
baseClass
- the base class.typeAttr
- the type attribute.mdef
- the mapping entries.protected XmlWriteHandler getMapping(java.lang.Class classToWrite) throws XMLWriterException
classToWrite
- the class for which to find a handler.XMLWriterException
- if no handler could be found for the given class.public void write(java.lang.String tagName, java.lang.Object object, java.lang.Class baseClass, XMLWriter writer) throws java.io.IOException, XMLWriterException
tagName
- the tagname for the xml-element containing the object
definition. The tagname must not be null.object
- the object which should be written.baseClass
- the base class.writer
- the xml writer used to write the content, never null.java.io.IOException
- if an IOException occures.XMLWriterException
- if an object model related error occures during
the writing.protected XmlWriteHandler loadHandlerClass(java.lang.String className) throws XMLWriterException
className
- the name of the class to be loaded.XMLWriterException
- if there is a writer exception.