|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.components.sax.AbstractXMLByteStreamInterpreter
public abstract class AbstractXMLByteStreamInterpreter
This a simple xml compiler which takes a byte array as input.
If you want to reuse this interpreter make sure to call first recycle()
and then set the new consumer for the sax events.
Field Summary | |
---|---|
protected ContentHandler |
contentHandler
The ContentHandler receiving SAX events. |
protected static ContentHandler |
EMPTY_CONTENT_HANDLER
|
protected LexicalHandler |
lexicalHandler
The LexicalHandler receiving SAX events. |
Fields inherited from interface org.apache.cocoon.components.sax.XMLByteStreamConstants |
---|
CHARACTERS, COMMENT, END_CDATA, END_DOCUMENT, END_DTD, END_ELEMENT, END_ENTITY, END_PREFIX_MAPPING, IGNORABLE_WHITESPACE, LOCATOR, PROCESSING_INSTRUCTION, SKIPPED_ENTITY, START_CDATA, START_DOCUMENT, START_DTD, START_ELEMENT, START_ENTITY, START_PREFIX_MAPPING |
Constructor Summary | |
---|---|
AbstractXMLByteStreamInterpreter()
|
Method Summary | |
---|---|
protected void |
parse()
This method needs to be used by sub classes to start the parsing of the byte stream |
protected abstract int |
read()
|
protected abstract int |
read(byte[] b)
|
protected int |
readEvent()
|
void |
recycle()
|
void |
setConsumer(XMLConsumer consumer)
Set the XMLConsumer that will receive XML data. |
void |
setContentHandler(ContentHandler handler)
Set the ContentHandler that will receive XML data. |
void |
setLexicalHandler(LexicalHandler handler)
Set the LexicalHandler that will receive XML data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final ContentHandler EMPTY_CONTENT_HANDLER
protected ContentHandler contentHandler
ContentHandler
receiving SAX events.
protected LexicalHandler lexicalHandler
LexicalHandler
receiving SAX events.
Constructor Detail |
---|
public AbstractXMLByteStreamInterpreter()
Method Detail |
---|
public void setConsumer(XMLConsumer consumer)
XMLConsumer
that will receive XML data.
setContentHandler(consumer)
and setLexicalHandler(consumer)
.
setConsumer
in interface XMLProducer
public void setContentHandler(ContentHandler handler)
ContentHandler
that will receive XML data.
ContentHandler
instance
accessing the protected super.contentHandler
field.
public void setLexicalHandler(LexicalHandler handler)
LexicalHandler
that will receive XML data.
LexicalHandler
instance
accessing the protected super.lexicalHandler
field.
public void recycle()
protected void parse() throws SAXException
SAXException
protected int readEvent() throws SAXException
SAXException
protected abstract int read() throws SAXException
SAXException
protected abstract int read(byte[] b) throws SAXException
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |