| java.lang.Object org.apache.cocoon.xml.AbstractSAXFragment org.apache.cocoon.xml.SaxBuffer
All known Subclasses: org.apache.cocoon.xml.ParamSaxBuffer,
SaxBuffer | public class SaxBuffer extends AbstractSAXFragment implements XMLConsumer,Recyclable,Serializable(Code) | | A class that can record SAX events and replay them later.
Compared to
org.apache.cocoon.components.sax.XMLByteStreamCompiler ,
this class is many times faster at sending out the recorded SAX events since
it doesn't need to convert between byte and char representations etc.
On the other hand, its data structure is more complex then a simple byte array,
making XMLByteStreamCompiler better in case the recorded SAX should be stored long-term.
Use this class if you need to frequently generate smaller amounts of SAX events,
or replay a set of recorded start events immediately.
Both
ContentHandler and
LexicalHandler are supported, the only
exception is that the setDocumentLocator event is not recorded.
version: CVS $Id: SaxBuffer.java 433543 2006-08-22 06:22:54Z crossley $ |
Inner Class :interface SaxBit | |
Inner Class :final public static class StartDocument implements SaxBit,Serializable | |
Inner Class :final public static class EndDocument implements SaxBit,Serializable | |
Inner Class :final public static class PI implements SaxBit,Serializable | |
Inner Class :final public static class StartDTD implements SaxBit,Serializable | |
Inner Class :final public static class EndDTD implements SaxBit,Serializable | |
Inner Class :final public static class StartEntity implements SaxBit,Serializable | |
Inner Class :final public static class EndEntity implements SaxBit,Serializable | |
Inner Class :final public static class SkippedEntity implements SaxBit,Serializable | |
Inner Class :final public static class StartPrefixMapping implements SaxBit,Serializable | |
Inner Class :final public static class EndPrefixMapping implements SaxBit,Serializable | |
Inner Class :final public static class StartElement implements SaxBit,Serializable | |
Inner Class :final public static class EndElement implements SaxBit,Serializable | |
Inner Class :final public static class Characters implements SaxBit,Serializable | |
Inner Class :final public static class Comment implements SaxBit,Serializable | |
Inner Class :final public static class StartCDATA implements SaxBit,Serializable | |
Inner Class :final public static class EndCDATA implements SaxBit,Serializable | |
Inner Class :final public static class IgnorableWhitespace implements SaxBit,Serializable | |
Inner Class :final public static class XMLizableBit implements SaxBit,Serializable | |
Field Summary | |
protected List | saxbits Stores list of
SaxBit objects. |
Method Summary | |
final protected void | addBit(SaxBit bit) | final protected Iterator | bits() | public void | characters(char ch, int start, int length) | public void | comment(char ch, int start, int length) | public void | dump(Writer writer) Dump buffer contents into the provided writer. | public void | endCDATA() | public void | endDTD() | public void | endDocument() | public void | endElement(String namespaceURI, String localName, String qName) | public void | endEntity(String name) | public void | endPrefixMapping(String prefix) | public List | getBits() | public void | ignorableWhitespace(char ch, int start, int length) | public boolean | isEmpty() | public void | processingInstruction(String target, String data) | public void | recycle() | public void | setDocumentLocator(Locator locator) | public void | skippedEntity(String name) | public void | startCDATA() | public void | startDTD(String name, String publicId, String systemId) | public void | startDocument() | public void | startElement(String namespaceURI, String localName, String qName, Attributes atts) | public void | startEntity(String name) | public void | startPrefixMapping(String prefix, String uri) | public void | toSAX(ContentHandler contentHandler) Stream this buffer into the provided content handler. | public String | toString() | public void | xmlizable(XMLizable xml) |
saxbits | protected List saxbits(Code) | | Stores list of
SaxBit objects.
|
SaxBuffer | public SaxBuffer()(Code) | | Creates empty SaxBuffer
|
SaxBuffer | public SaxBuffer(List bits)(Code) | | Creates SaxBuffer based on the provided bits list.
|
SaxBuffer | public SaxBuffer(SaxBuffer saxBuffer)(Code) | | Creates copy of another SaxBuffer
|
addBit | final protected void addBit(SaxBit bit)(Code) | | Adds a SaxBit to the bits list
|
bits | final protected Iterator bits()(Code) | | Iterates through the bits list
|
characters | public void characters(char ch, int start, int length) throws SAXException(Code) | | |
getBits | public List getBits()(Code) | | unmodifiable list of SAX bits |
ignorableWhitespace | public void ignorableWhitespace(char ch, int start, int length) throws SAXException(Code) | | |
isEmpty | public boolean isEmpty()(Code) | | true if buffer is empty |
recycle | public void recycle()(Code) | | Clear this buffer
|
setDocumentLocator | public void setDocumentLocator(Locator locator)(Code) | | |
toSAX | public void toSAX(ContentHandler contentHandler) throws SAXException(Code) | | Stream this buffer into the provided content handler.
If contentHandler object implements LexicalHandler, it will get lexical
events as well.
|
toString | public String toString()(Code) | | String value of the buffer |
xmlizable | public void xmlizable(XMLizable xml)(Code) | | Add a bit containing XMLizable object
|
|
|