org.exolab.castor.xml.util

Class SAX2ANY

Implemented Interfaces:
ContentHandler, DocumentHandler, ErrorHandler

public class SAX2ANY
extends java.lang.Object
implements ContentHandler, DocumentHandler, ErrorHandler

This class is a SAX Content Handler that build an AnyNode from a stream of SAX events (either SAX1 for compatibility or SAX2)
Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:09:48 $
Author:

Constructor Summary

SAX2ANY()
Default constructor
SAX2ANY(Namespaces context)
Constructs a SAX2ANY given a namespace context.

Method Summary

void
characters(char[] ch, int start, int length)
void
endDocument()
void
endElement(String name)
void
endElement(String namespaceURI, String localName, String qName)
void
endPrefixMapping(String prefix)
void
error(SAXParseException e)
void
fatalError(SAXParseException e)
Namespaces
getNamespaceContext()
Get the namespace context of this SAX2ANY handler.
AnyNode
getStartingNode()
void
ignorableWhitespace(char[] ch, int start, int length)
void
processingInstruction(String target, String data)
void
setDocumentLocator(Locator locator)
Sets the document locator of the current parsed inputsource
void
setNamespaceContext(Namespaces context)
Set the namespace context in which this handler acts.
void
skippedEntity(String name)
void
startDocument()
void
startElement(String name, AttributeList atts)
Implementation of org.xml.sax.DocumentHandler.startElement
void
startElement(String namespaceURI, String localName, String qName, Attributes atts)
Implementation of org.xml.sax.ContentHandler.startElement
void
startPrefixMapping(String prefix, String uri)
void
warning(SAXParseException e)

Constructor Details

SAX2ANY

public SAX2ANY()
Default constructor

SAX2ANY

public SAX2ANY(Namespaces context)
Constructs a SAX2ANY given a namespace context.
Parameters:
context - the namespace context in which this handler acts.

Method Details

characters

public void characters(char[] ch,
                       int start,
                       int length)
            throws SAXException

endDocument

public void endDocument()
            throws SAXException

endElement

public void endElement(String name)
            throws SAXException

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
            throws SAXException

endPrefixMapping

public void endPrefixMapping(String prefix)
            throws SAXException

error

public void error(SAXParseException e)
            throws SAXException

fatalError

public void fatalError(SAXParseException e)
            throws SAXException

getNamespaceContext

public Namespaces getNamespaceContext()
Get the namespace context of this SAX2ANY handler. If the SAX2ANY handler is called during the processing of an XML document, it may happen that the XML fragment parsed by the SAX2ANY handler contains references to namespaces declared in the given context.
Returns:
the namespace context to interact with while parsing an XML fragment with the SAX2ANY handler

getStartingNode

public AnyNode getStartingNode()

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
            throws SAXException

processingInstruction

public void processingInstruction(String target,
                                  String data)
            throws SAXException

setDocumentLocator

public void setDocumentLocator(Locator locator)
Sets the document locator of the current parsed inputsource
Parameters:
locator - the Locator of the current parsed inputsource

setNamespaceContext

public void setNamespaceContext(Namespaces context)
Set the namespace context in which this handler acts. If this handler is called during the processing of an XML document, it may happen that the XML fragment parsed by the SAX2ANY handler contains references to namespaces declared in the given context.
Parameters:
context - the namespace context to interact with while parsing an XML fragment with the SAX2ANY handler.

skippedEntity

public void skippedEntity(String name)
            throws SAXException

startDocument

public void startDocument()
            throws SAXException

startElement

public void startElement(String name,
                         AttributeList atts)
            throws SAXException
Implementation of org.xml.sax.DocumentHandler.startElement

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts)
            throws SAXException
Implementation of org.xml.sax.ContentHandler.startElement

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
            throws SAXException

warning

public void warning(SAXParseException e)
            throws SAXException

Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com