org.xeril.xml
Interface XmlMapper

All Known Implementing Classes:
XmlMapperClass, XmlMapperDate, XmlMapperDateTime, XmlMapperFile, XmlMapperURL

public interface XmlMapper

This interface is the one that needs to be implemented for allowing mapping and unmmapping of Objects between Java and XML. See the XmlMapperDate class for an example of implementation.


Method Summary
 java.lang.String map(java.lang.Object o)
          Maps an object to its XML representation (which is a String)
 java.lang.Object unmap(java.lang.String s)
          Unmaps an object from its XML representation.
 

Method Detail

map

public java.lang.String map(java.lang.Object o)
                     throws XmlMapperException
Maps an object to its XML representation (which is a String)

Parameters:
o - the object to map
Returns:
the xml representation of the object
Throws:
XmlMapperException - when there is a map problem (for example o is of the wrong type...)

unmap

public java.lang.Object unmap(java.lang.String s)
                       throws XmlMapperException
Unmaps an object from its XML representation.

Parameters:
s - the xml representation of the object
Returns:
the object rebuilt
Throws:
XmlMapperException - when the unmmap operation is impossible