java.lang.Object
org.xbib.content.xml.stream.StaxEventContentHandler
- All Implemented Interfaces:
ContentHandler
SAX
ContentHandler that transforms callback calls to XMLEvents and writes them to a
XMLEventConsumer.-
Constructor Summary
ConstructorsConstructorDescriptionStaxEventContentHandler(XMLEventConsumer consumer) Constructs a new instance of theStaxEventContentHandlerthat writes to the givenXMLEventConsumer.StaxEventContentHandler(XMLEventConsumer consumer, XMLEventFactory factory) Constructs a new instance of theStaxEventContentHandlerthat uses the given event factory to create events and writes to the givenXMLEventConsumer. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidcharacters(char[] ch, int start, int length) protected voidcharactersInternal(char[] ch, int start, int length) final voidprotected voidfinal voidendElement(String uri, String localName, String qName) protected voidendElementInternal(QName name, SimpleNamespaceContext namespaceContext) final voidendPrefixMapping(String prefix) Removes the binding for the given prefix.final voidignorableWhitespace(char[] ch, int start, int length) protected voidignorableWhitespaceInternal(char[] ch, int start, int length) final voidprocessingInstruction(String target, String data) protected voidprocessingInstructionInternal(String target, String data) voidsetDocumentLocator(Locator locator) final voidskippedEntity(String name) protected voidskippedEntityInternal(String name) final voidprotected voidfinal voidstartElement(String uri, String localName, String qName, Attributes atts) protected voidstartElementInternal(QName name, Attributes atts, SimpleNamespaceContext namespaceContext) final voidstartPrefixMapping(String prefix, String uri) Binds the given prefix to the given namespaces.Methods 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
-
StaxEventContentHandler
Constructs a new instance of theStaxEventContentHandlerthat writes to the givenXMLEventConsumer. A defaultXMLEventFactorywill be created.- Parameters:
consumer- the consumer to write events to
-
StaxEventContentHandler
Constructs a new instance of theStaxEventContentHandlerthat uses the given event factory to create events and writes to the givenXMLEventConsumer.- Parameters:
consumer- the consumer to write events tofactory- the factory used to create events
-
-
Method Details
-
setDocumentLocator
-
startDocumentInternal
- Throws:
XMLStreamException
-
endDocumentInternal
- Throws:
XMLStreamException
-
startElementInternal
protected void startElementInternal(QName name, Attributes atts, SimpleNamespaceContext namespaceContext) throws XMLStreamException - Throws:
XMLStreamException
-
endElementInternal
protected void endElementInternal(QName name, SimpleNamespaceContext namespaceContext) throws XMLStreamException - Throws:
XMLStreamException
-
charactersInternal
- Throws:
XMLStreamException
-
ignorableWhitespaceInternal
protected void ignorableWhitespaceInternal(char[] ch, int start, int length) throws XMLStreamException - Throws:
XMLStreamException
-
processingInstructionInternal
- Throws:
XMLStreamException
-
skippedEntityInternal
- Throws:
XMLStreamException
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
Binds the given prefix to the given namespaces.- Specified by:
startPrefixMappingin interfaceContentHandler- See Also:
-
endPrefixMapping
Removes the binding for the given prefix.- Specified by:
endPrefixMappingin interfaceContentHandler- See Also:
-
startElement
public final void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespacein interfaceContentHandler- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler- Throws:
SAXException
-