net.sf.xolite.utils
Class XMLSkipper

java.lang.Object
  extended by net.sf.xolite.utils.XMLSkipper
All Implemented Interfaces:
XMLSerializable

public class XMLSkipper
extends Object
implements XMLSerializable

XMLSerializable that allow to ignore a whole complex XML element during parsing.

Author:
Olivier Berlanger
See Also:
XMLEventParser, XMLSerializer

Constructor Summary
XMLSkipper()
           
 
Method Summary
 void endElement(String uri, String localName, XMLEventParser parser)
          Receive notification of the end of an element.
 void serialize(XMLSerializer serializer)
          This object is not intended for serialization as it does not keep its XML content while parsing.
 void startElement(String uri, String localName, XMLEventParser parser)
          Receive notification of the start of an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLSkipper

public XMLSkipper()
Method Detail

startElement

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

Specified by:
startElement in interface XMLSerializable
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

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

Specified by:
endElement in interface XMLSerializable
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

public void serialize(XMLSerializer serializer)
               throws XMLSerializeException
This object is not intended for serialization as it does not keep its XML content while parsing.

Specified by:
serialize in interface XMLSerializable
Parameters:
serializer - The object implementing the actual serialization.
Throws:
XMLSerializeException - if something fails.


Copyright © 2012. All Rights Reserved.