|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
javanet.staxutils.StAXContentHandler
javanet.staxutils.StAXEventContentHandler
public class StAXEventContentHandler
SAX ContentHandler that writes events to a StAX XMLEventConsumer.
| Field Summary |
|---|
| Fields inherited from class javanet.staxutils.StAXContentHandler |
|---|
CDATABuffer, docLocator, isCDATA, namespaces, reporter |
| Constructor Summary | |
|---|---|
StAXEventContentHandler()
Constructs a default instance with a default event factory. |
|
StAXEventContentHandler(XMLEventConsumer consumer)
Constructs an instance that writes events to the provided XMLEventConsumer. |
|
StAXEventContentHandler(XMLEventConsumer consumer,
XMLEventFactory factory)
Constructs an instance that writes events constructed with the provided XMLEventFactory to the provided XMLEventConsumer |
|
| Method Summary | |
|---|---|
void |
characters(char[] ch,
int start,
int length)
|
void |
comment(char[] ch,
int start,
int length)
|
protected Namespace |
createNamespace(String prefix,
String uri)
|
protected void |
createStartEvents(Attributes attributes,
Collection[] events)
Creates the Namespaceand Attributeevents associated
with a StartElement. |
void |
endCDATA()
|
void |
endDocument()
|
void |
endElement(String uri,
String localName,
String qName)
|
XMLEventConsumer |
getEventConsumer()
Returns a reference to the XMLEventConsumer to which events will
be written. |
XMLEventFactory |
getEventFactory()
Returns a reference to the XMLEventFactory used to construct
events. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
void |
processingInstruction(String target,
String data)
|
void |
setEventConsumer(XMLEventConsumer consumer)
Sets the XMLEventConsumer to which events are written. |
void |
setEventFactory(XMLEventFactory factory)
Sets the XMLEventFactory used to create events. |
void |
startDocument()
|
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes)
|
| Methods inherited from class javanet.staxutils.StAXContentHandler |
|---|
endDTD, endEntity, endPrefixMapping, error, fatalError, getCurrentLocation, parseQName, reportException, setDocumentLocator, setXMLReporter, startCDATA, startDTD, startEntity, startPrefixMapping, warning |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
notationDecl, resolveEntity, skippedEntity, unparsedEntityDecl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StAXEventContentHandler()
XMLEventConsumervia the
setEventConsumer(XMLEventConsumer)method.
public StAXEventContentHandler(XMLEventConsumer consumer)
consumer - The XMLEventConsumerto which events will be
written.
public StAXEventContentHandler(XMLEventConsumer consumer,
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.| Method Detail |
|---|
public XMLEventConsumer getEventConsumer()
XMLEventConsumer to which events will
be written.
XMLEventConsumer to which events will be written.public void setEventConsumer(XMLEventConsumer consumer)
XMLEventConsumer to which events are written.
consumer - The XMLEventConsumer to which events will be
written.public XMLEventFactory getEventFactory()
XMLEventFactory used to construct
events.
XMLEventFactory used to construct events.public void setEventFactory(XMLEventFactory factory)
XMLEventFactory used to create events.
factory - The XMLEventFactory used to create events.
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class StAXContentHandlerSAXException
public void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class StAXContentHandlerSAXException
public void startElement(String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException
startElement in interface ContentHandlerstartElement in class StAXContentHandlerSAXException
public void endElement(String uri,
String localName,
String qName)
throws SAXException
endElement in interface ContentHandlerendElement in class StAXContentHandlerSAXException
public void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlercomment in class StAXContentHandlerSAXException
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class StAXContentHandlerSAXException
public void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerignorableWhitespace in class org.xml.sax.helpers.DefaultHandlerSAXException
public void processingInstruction(String target,
String data)
throws SAXException
processingInstruction in interface ContentHandlerprocessingInstruction in class org.xml.sax.helpers.DefaultHandlerSAXException
public void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerendCDATA in class StAXContentHandlerSAXException
protected void createStartEvents(Attributes attributes,
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 Namespace createNamespace(String prefix,
String uri)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||