public abstract class RootXmlWriteHandler extends Object
| Constructor and Description |
|---|
RootXmlWriteHandler()
Creates a new RootXmlWrite handler with the default mappings enabled.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addManualMapping(Class classToWrite,
Class handler)
Adds a new manual mapping to this handler.
|
protected void |
addMultiplexMapping(Class baseClass,
String typeAttr,
MultiplexMappingEntry[] mdef)
Adds a multiplex mapping.
|
protected abstract ObjectFactory |
getFactoryLoader()
Returns the object factory.
|
protected XmlWriteHandler |
getMapping(Class classToWrite)
Tries to find the mapping for the given class.
|
protected XmlWriteHandler |
loadHandlerClass(String className)
Loads the given class, and ignores all exceptions which may occur
during the loading.
|
void |
write(String tagName,
Object object,
Class baseClass,
XMLWriter writer)
Writes the given object with the specified tagname.
|
public RootXmlWriteHandler()
protected abstract ObjectFactory getFactoryLoader()
protected void addManualMapping(Class classToWrite, Class handler)
classToWrite - the class, which should be handledhandler - the write handler implementation for that class.protected void addMultiplexMapping(Class baseClass, String typeAttr, MultiplexMappingEntry[] mdef)
baseClass - the base class.typeAttr - the type attribute.mdef - the mapping entries.protected XmlWriteHandler getMapping(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(String tagName, Object object, Class baseClass, XMLWriter writer) throws 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.IOException - if an IOException occures.XMLWriterException - if an object model related error occures during
the writing.protected XmlWriteHandler loadHandlerClass(String className) throws XMLWriterException
className - the name of the class to be loaded.XMLWriterException - if there is a writer exception.Copyright © 2009-2012 jtstand.com. All Rights Reserved.