public class StAXEventContentHandler extends StAXContentHandler
XMLEventConsumer.CDATABuffer, docLocator, isCDATA, namespaces, reporter| Constructor and Description |
|---|
StAXEventContentHandler()
Constructs a default instance with a default event factory.
|
StAXEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer)
Constructs an instance that writes events to the provided
XMLEventConsumer.
|
StAXEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer,
javax.xml.stream.XMLEventFactory factory)
Constructs an instance that writes events constructed with the provided
XMLEventFactory to the provided XMLEventConsumer
|
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
comment(char[] ch,
int start,
int length) |
protected javax.xml.stream.events.Namespace |
createNamespace(java.lang.String prefix,
java.lang.String uri) |
protected void |
createStartEvents(org.xml.sax.Attributes attributes,
java.util.Collection[] events)
Creates the
Namespaceand Attributeevents associated
with a StartElement. |
void |
endCDATA() |
void |
endDocument() |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName) |
javax.xml.stream.util.XMLEventConsumer |
getEventConsumer()
Returns a reference to the
XMLEventConsumer to which events will
be written. |
javax.xml.stream.XMLEventFactory |
getEventFactory()
Returns a reference to the
XMLEventFactory used to construct
events. |
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
void |
processingInstruction(java.lang.String target,
java.lang.String data) |
void |
setEventConsumer(javax.xml.stream.util.XMLEventConsumer consumer)
Sets the
XMLEventConsumer to which events are written. |
void |
setEventFactory(javax.xml.stream.XMLEventFactory factory)
Sets the
XMLEventFactory used to create events. |
void |
startDocument() |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes) |
endDTD, endEntity, endPrefixMapping, error, fatalError, getCurrentLocation, parseQName, reportException, setDocumentLocator, setXMLReporter, startCDATA, startDTD, startEntity, startPrefixMapping, warningpublic StAXEventContentHandler()
XMLEventConsumervia the
setEventConsumer(XMLEventConsumer)method.public StAXEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer)
consumer - The XMLEventConsumerto which events will be
written.public StAXEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer,
javax.xml.stream.XMLEventFactory factory)
consumer - The XMLEventConsumer to which events will be
written.factory - The XMLEventFactory used to construct events. If
null, a default instance will be constructed.public javax.xml.stream.util.XMLEventConsumer getEventConsumer()
XMLEventConsumer to which events will
be written.XMLEventConsumer to which events will be written.public void setEventConsumer(javax.xml.stream.util.XMLEventConsumer consumer)
XMLEventConsumer to which events are written.consumer - The XMLEventConsumer to which events will be
written.public javax.xml.stream.XMLEventFactory getEventFactory()
XMLEventFactory used to construct
events.XMLEventFactory used to construct events.public void setEventFactory(javax.xml.stream.XMLEventFactory factory)
XMLEventFactory used to create events.factory - The XMLEventFactory used to create events.public void startDocument()
throws org.xml.sax.SAXException
startDocument in interface org.xml.sax.ContentHandlerstartDocument in class StAXContentHandlerorg.xml.sax.SAXExceptionpublic void endDocument()
throws org.xml.sax.SAXException
endDocument in interface org.xml.sax.ContentHandlerendDocument in class StAXContentHandlerorg.xml.sax.SAXExceptionpublic void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class StAXContentHandlerorg.xml.sax.SAXExceptionpublic void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandlerendElement in class StAXContentHandlerorg.xml.sax.SAXExceptionpublic void comment(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
comment in interface org.xml.sax.ext.LexicalHandlercomment in class StAXContentHandlerorg.xml.sax.SAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlercharacters in class StAXContentHandlerorg.xml.sax.SAXExceptionpublic void ignorableWhitespace(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
ignorableWhitespace in interface org.xml.sax.ContentHandlerignorableWhitespace in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionpublic void processingInstruction(java.lang.String target,
java.lang.String data)
throws org.xml.sax.SAXException
processingInstruction in interface org.xml.sax.ContentHandlerprocessingInstruction in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionpublic void endCDATA()
throws org.xml.sax.SAXException
endCDATA in interface org.xml.sax.ext.LexicalHandlerendCDATA in class StAXContentHandlerorg.xml.sax.SAXExceptionprotected void createStartEvents(org.xml.sax.Attributes attributes,
java.util.Collection[] events)
Namespaceand Attributeevents associated
with a StartElement.attributes - The SAX attributes object.events - An array used to return the two collections of
Namespaceand Attributeevents. The
namespaces will be placed at events[0] and the
attributes as events[1].protected javax.xml.stream.events.Namespace createNamespace(java.lang.String prefix,
java.lang.String uri)