org.spicefactory.cinnamon.io.xml
Class XomXmlAdapter

java.lang.Object
  extended by org.spicefactory.cinnamon.io.xml.XomXmlAdapter
All Implemented Interfaces:
XmlAdapter

public class XomXmlAdapter
extends Object
implements XmlAdapter

XmlAdapter implementation that converts Strings to/from XOM document instances.

Author:
Jens Halm

Constructor Summary
XomXmlAdapter()
           
 
Method Summary
 Object buildDocument(String xml)
          Builds an XML DOM instance from the given string.
 void init()
          Initializes the adapter, called once for each instance at application startup.
 boolean isXmlDocumentClass(Class<?> type)
          Checks whether the given class represents an XML DOM class that this adapter can process.
 String toXmlString(Object object)
          Returns the String representation for the given DOM instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XomXmlAdapter

public XomXmlAdapter()
Method Detail

init

public void init()
Description copied from interface: XmlAdapter
Initializes the adapter, called once for each instance at application startup.

Specified by:
init in interface XmlAdapter

buildDocument

public Object buildDocument(String xml)
Description copied from interface: XmlAdapter
Builds an XML DOM instance from the given string.

Specified by:
buildDocument in interface XmlAdapter
Parameters:
xml - the XML document as a string
Returns:
a DOM instance

isXmlDocumentClass

public boolean isXmlDocumentClass(Class<?> type)
Description copied from interface: XmlAdapter
Checks whether the given class represents an XML DOM class that this adapter can process.

Specified by:
isXmlDocumentClass in interface XmlAdapter
Parameters:
type - the class to check
Returns:
true if the given object represents an XML DOM instance that this adapter can process

toXmlString

public String toXmlString(Object object)
Description copied from interface: XmlAdapter
Returns the String representation for the given DOM instance.

Specified by:
toXmlString in interface XmlAdapter
Parameters:
object - the DOM instance
Returns:
the String representation for the given DOM instance