net.sf.jagzilla.hibernate
Interface XmlObject

All Known Implementing Classes:
Product, Profile, XmlObjectImpl

public interface XmlObject

Interface that identifies a class that can be serialized as XML. An object implementing this interface must be able to persist it's data to XML and set it's values from an XML.

Author:
mike

Method Summary
 java.lang.String getXmlString()
          returns a String containing the XML representation of the object.
 void loadFromXml(java.io.Reader reader)
          load the object data from xml.
 void toXml(java.io.Writer writer)
          marhsall the object to xml and place it in writer.
 

Method Detail

toXml

public void toXml(java.io.Writer writer)
           throws java.io.IOException,
                  MappingException,
                  MarshalException,
                  ValidationException
marhsall the object to xml and place it in writer. This method internally uses castor.

Parameters:
writer -
Throws:
java.io.IOException
MappingException
MarshalException
ValidationException

loadFromXml

public void loadFromXml(java.io.Reader reader)
                 throws java.io.IOException,
                        MappingException,
                        MarshalException,
                        ValidationException
load the object data from xml. This method internally uses castor to unmarshall the object form XML.

Parameters:
reader - a reader containing a parseable xml
Throws:
java.io.IOException
MappingException
MarshalException
ValidationException

getXmlString

public java.lang.String getXmlString()
                              throws java.io.IOException,
                                     MappingException,
                                     MarshalException,
                                     ValidationException
returns a String containing the XML representation of the object. This method internally calls toXml, exceptions thrown from this method are not caught.

Throws:
java.io.IOException - if toXml throws it
MappingException - if toXml throws it
MarshalException - if toXml throws it
ValidationException - if toXml throws it
See Also:
toXml(Writer)


Distributed under the GPL. By Miguel Griffa. See the Jagzilla project page for more info.