Package org.apache.cocoon.xml.sax
Class SAXBuffer
- java.lang.Object
 - 
- org.apache.cocoon.xml.sax.SAXBuffer
 
 
- 
- All Implemented Interfaces:
 java.io.Serializable,org.xml.sax.ContentHandler,org.xml.sax.ext.LexicalHandler
@Deprecated(since="2022-01-27") public class SAXBuffer extends java.lang.Object implements org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler, java.io.SerializableDeprecated.This API is deprecated, migrate code to the XML APIs provided by the JDK.A class that can record SAX events and replay them later.Compared to the old Cocoon.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
ContentHandlerandLexicalHandlerare supported, the only exception is that the setDocumentLocator event is not recorded.- See Also:
 - Serialized Form
 
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSAXBuffer.CharactersDeprecated.static classSAXBuffer.CommentDeprecated.static classSAXBuffer.EndCDATADeprecated.static classSAXBuffer.EndDocumentDeprecated.static classSAXBuffer.EndDTDDeprecated.static classSAXBuffer.EndElementDeprecated.static classSAXBuffer.EndEntityDeprecated.static classSAXBuffer.EndPrefixMappingDeprecated.static classSAXBuffer.IgnorableWhitespaceDeprecated.static classSAXBuffer.PIDeprecated.static classSAXBuffer.SkippedEntityDeprecated.static classSAXBuffer.StartCDATADeprecated.static classSAXBuffer.StartDocumentDeprecated.static classSAXBuffer.StartDTDDeprecated.static classSAXBuffer.StartElementDeprecated.static classSAXBuffer.StartEntityDeprecated.static classSAXBuffer.StartPrefixMappingDeprecated.static classSAXBuffer.XMLizableBitDeprecated. 
- 
Constructor Summary
Constructors Constructor Description SAXBuffer()Deprecated.Creates empty SaxBufferSAXBuffer(java.util.List<org.apache.cocoon.xml.sax.SAXBuffer.SaxBit> bits)Deprecated.Creates SaxBuffer based on the provided bits list.SAXBuffer(SAXBuffer saxBuffer)Deprecated.Creates copy of another SaxBuffer 
- 
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)Deprecated.voidcomment(char[] ch, int start, int length)Deprecated.voiddump(java.io.Writer writer)Deprecated.Dump buffer contents into the provided writer.voidendCDATA()Deprecated.voidendDocument()Deprecated.voidendDTD()Deprecated.voidendElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)Deprecated.voidendEntity(java.lang.String name)Deprecated.voidendPrefixMapping(java.lang.String prefix)Deprecated.java.util.List<org.apache.cocoon.xml.sax.SAXBuffer.SaxBit>getBits()Deprecated.voidignorableWhitespace(char[] ch, int start, int length)Deprecated.booleanisEmpty()Deprecated.voidprocessingInstruction(java.lang.String target, java.lang.String data)Deprecated.voidrecycle()Deprecated.Clear this buffervoidsaxBuffer(SAXBuffer xml)Deprecated.Add a another buffervoidsetDocumentLocator(org.xml.sax.Locator locator)Deprecated.voidskippedEntity(java.lang.String name)Deprecated.voidstartCDATA()Deprecated.voidstartDocument()Deprecated.voidstartDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)Deprecated.voidstartElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)Deprecated.voidstartEntity(java.lang.String name)Deprecated.voidstartPrefixMapping(java.lang.String prefix, java.lang.String uri)Deprecated.voidtoSAX(org.xml.sax.ContentHandler contentHandler)Deprecated.Stream this buffer into the provided content handler.java.lang.StringtoString()Deprecated. 
 - 
 
- 
- 
Constructor Detail
- 
SAXBuffer
public SAXBuffer()
Deprecated.Creates empty SaxBuffer 
- 
SAXBuffer
public SAXBuffer(java.util.List<org.apache.cocoon.xml.sax.SAXBuffer.SaxBit> bits)
Deprecated.Creates SaxBuffer based on the provided bits list. 
- 
SAXBuffer
public SAXBuffer(SAXBuffer saxBuffer)
Deprecated.Creates copy of another SaxBuffer 
 - 
 
- 
Method Detail
- 
skippedEntity
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 skippedEntityin interfaceorg.xml.sax.ContentHandler- Throws:
 org.xml.sax.SAXException
 
- 
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
Deprecated.- Specified by:
 setDocumentLocatorin interfaceorg.xml.sax.ContentHandler
 
- 
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 ignorableWhitespacein interfaceorg.xml.sax.ContentHandler- Throws:
 org.xml.sax.SAXException
 
- 
processingInstruction
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 processingInstructionin interfaceorg.xml.sax.ContentHandler- Throws:
 org.xml.sax.SAXException
 
- 
startDocument
public void startDocument() throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 startDocumentin interfaceorg.xml.sax.ContentHandler- Throws:
 org.xml.sax.SAXException
 
- 
startElement
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 startElementin interfaceorg.xml.sax.ContentHandler- Throws:
 org.xml.sax.SAXException
 
- 
endPrefixMapping
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 endPrefixMappingin interfaceorg.xml.sax.ContentHandler- Throws:
 org.xml.sax.SAXException
 
- 
characters
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 charactersin interfaceorg.xml.sax.ContentHandler- Throws:
 org.xml.sax.SAXException
 
- 
endElement
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 endElementin interfaceorg.xml.sax.ContentHandler- Throws:
 org.xml.sax.SAXException
 
- 
endDocument
public void endDocument() throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 endDocumentin interfaceorg.xml.sax.ContentHandler- Throws:
 org.xml.sax.SAXException
 
- 
startPrefixMapping
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 startPrefixMappingin interfaceorg.xml.sax.ContentHandler- Throws:
 org.xml.sax.SAXException
 
- 
endCDATA
public void endCDATA() throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 endCDATAin interfaceorg.xml.sax.ext.LexicalHandler- Throws:
 org.xml.sax.SAXException
 
- 
comment
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 commentin interfaceorg.xml.sax.ext.LexicalHandler- Throws:
 org.xml.sax.SAXException
 
- 
startEntity
public void startEntity(java.lang.String name) throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 startEntityin interfaceorg.xml.sax.ext.LexicalHandler- Throws:
 org.xml.sax.SAXException
 
- 
endDTD
public void endDTD() throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 endDTDin interfaceorg.xml.sax.ext.LexicalHandler- Throws:
 org.xml.sax.SAXException
 
- 
startDTD
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 startDTDin interfaceorg.xml.sax.ext.LexicalHandler- Throws:
 org.xml.sax.SAXException
 
- 
startCDATA
public void startCDATA() throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 startCDATAin interfaceorg.xml.sax.ext.LexicalHandler- Throws:
 org.xml.sax.SAXException
 
- 
endEntity
public void endEntity(java.lang.String name) throws org.xml.sax.SAXExceptionDeprecated.- Specified by:
 endEntityin interfaceorg.xml.sax.ext.LexicalHandler- Throws:
 org.xml.sax.SAXException
 
- 
saxBuffer
public void saxBuffer(SAXBuffer xml)
Deprecated.Add a another buffer 
- 
isEmpty
public boolean isEmpty()
Deprecated.- Returns:
 - true if buffer is empty
 
 
- 
getBits
public java.util.List<org.apache.cocoon.xml.sax.SAXBuffer.SaxBit> getBits()
Deprecated.- Returns:
 - unmodifiable list of SAX bits
 
 
- 
toSAX
public void toSAX(org.xml.sax.ContentHandler contentHandler) throws org.xml.sax.SAXExceptionDeprecated.Stream this buffer into the provided content handler. If contentHandler object implements LexicalHandler, it will get lexical events as well.- Throws:
 org.xml.sax.SAXException
 
- 
toString
public java.lang.String toString()
Deprecated.- Overrides:
 toStringin classjava.lang.Object- Returns:
 - String value of the buffer
 
 
- 
recycle
public void recycle()
Deprecated.Clear this buffer 
- 
dump
public void dump(java.io.Writer writer) throws java.io.IOExceptionDeprecated.Dump buffer contents into the provided writer.- Throws:
 java.io.IOException
 
 - 
 
 -