net.sf.xolite
Interface XMLSerializable

All Known Implementing Classes:
RootHolder, XMLSkipper

public interface XMLSerializable

Interface implemented by object to be serialisable (back and forth) to XML.

Author:
Olivier Berlanger
See Also:
XMLEventParser, XMLSerializer

Method Summary
 void endElement(String uri, String localName, XMLEventParser parser)
          Receive notification of the end of an element.
 void serialize(XMLSerializer serializer)
          Serialize this object to an XML representation (in a DOM tree, a Stream, ...).
 void startElement(String uri, String localName, XMLEventParser parser)
          Receive notification of the start of an element.
 

Method Detail

startElement

void startElement(String uri,
                  String localName,
                  XMLEventParser parser)
                  throws XMLParseException
Receive notification of the start of an element. (Method for simplified event-driven parsing = simplified SAX)

Parameters:
uri - The started element namespace URI.
localName - The started element local name (= name without the namespace prefix) .
parser - The current XML event parser. From this parser you can get the attributes of the started element, the SAX Locator, the defined namespace prefix mappings.
Throws:
XMLParseException - Any SAX exception, possibly wrapping another exception.
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

endElement

void endElement(String uri,
                String localName,
                XMLEventParser parser)
                throws XMLParseException
Receive notification of the end of an element. (Method for simplified event-driven parsing = simplified SAX)

Parameters:
uri - The ended element namespace URI.
localName - The ended element local name (= name without the namespace prefix) .
parser - The current XML event parser. From this parser you can get SAX Locator or the text content of the ended element.
Throws:
XMLParseException - Any SAX exception, possibly wrapping another exception.
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

serialize

void serialize(XMLSerializer serializer)
               throws XMLSerializeException
Serialize this object to an XML representation (in a DOM tree, a Stream, ...). (Method for serialisation using a visitor pattern.)

Parameters:
serializer - The object implementing the actual serialization.
Throws:
XMLSerializeException - if something fails.


Copyright © 2012. All Rights Reserved.