Package org.exolab.castor.xml.util
Class SAX2ANY
java.lang.Object
org.exolab.castor.xml.util.SAX2ANY
- All Implemented Interfaces:
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: 6671 $ $Date: 2006-04-29 09:44:19 -0600 (Sat, 29 Apr 2006) $
- Author:
- invalid input: '<'a href="blandin@intalio.com>Arnaud Blandin
-
Constructor Summary
ConstructorsConstructorDescriptionSAX2ANY()Default constructorSAX2ANY(Namespaces context, boolean wsPreserve) Constructs a SAX2ANY given a namespace context. -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) voidvoidendElement(String name) voidendElement(String namespaceURI, String localName, String qName) voidendPrefixMapping(String prefix) voidvoidGet the namespace context of this SAX2ANY handler.voidignorableWhitespace(char[] ch, int start, int length) voidprocessingInstruction(String target, String data) voidsetDocumentLocator(Locator locator) Sets the document locator of the current parsed inputsourcevoidsetNamespaceContext(Namespaces context) Set the namespace context in which this handler acts.voidskippedEntity(String name) voidvoidstartElement(String namespaceURI, String localName, String qName, Attributes atts) voidstartElement(String name, AttributeList atts) voidstartPrefixMapping(String prefix, String uri) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
SAX2ANY
public SAX2ANY()Default constructor -
SAX2ANY
Constructs a SAX2ANY given a namespace context.- Parameters:
context- the namespace context in which this handler acts.wsPreserve- if white spaces whould be preserved
-
-
Method Details
-
setDocumentLocator
Sets the document locator of the current parsed inputsource- Specified by:
setDocumentLocatorin interfaceContentHandler- Specified by:
setDocumentLocatorin interfaceDocumentHandler- Parameters:
locator- the Locator of the current parsed inputsource
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Specified by:
startDocumentin interfaceDocumentHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Specified by:
endDocumentin interfaceDocumentHandler- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespacein interfaceContentHandler- Specified by:
ignorableWhitespacein interfaceDocumentHandler- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler- Specified by:
processingInstructionin interfaceDocumentHandler- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
startElement
- Specified by:
startElementin interfaceDocumentHandler- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException Implementation ofContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)- Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceDocumentHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Specified by:
charactersin interfaceDocumentHandler- Throws:
SAXException
-
warning
- Specified by:
warningin interfaceErrorHandler- Throws:
SAXException
-
error
- Specified by:
errorin interfaceErrorHandler- Throws:
SAXException
-
fatalError
- Specified by:
fatalErrorin interfaceErrorHandler- Throws:
SAXException
-
getStartingNode
-
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
-
setNamespaceContext
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.
-