Package org.apache.cocoon.xml.sax
Class SAXBuffer
- java.lang.Object
-
- org.apache.cocoon.xml.sax.SAXBuffer
-
- All Implemented Interfaces:
Serializable,ContentHandler,LexicalHandler
@Deprecated(since="2022-01-27") public class SAXBuffer extends Object implements ContentHandler, LexicalHandler, Serializable
Deprecated.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(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(Writer writer)Deprecated.Dump buffer contents into the provided writer.voidendCDATA()Deprecated.voidendDocument()Deprecated.voidendDTD()Deprecated.voidendElement(String namespaceURI, String localName, String qName)Deprecated.voidendEntity(String name)Deprecated.voidendPrefixMapping(String prefix)Deprecated.List<org.apache.cocoon.xml.sax.SAXBuffer.SaxBit>getBits()Deprecated.voidignorableWhitespace(char[] ch, int start, int length)Deprecated.booleanisEmpty()Deprecated.voidprocessingInstruction(String target, String data)Deprecated.voidrecycle()Deprecated.Clear this buffervoidsaxBuffer(SAXBuffer xml)Deprecated.Add a another buffervoidsetDocumentLocator(Locator locator)Deprecated.voidskippedEntity(String name)Deprecated.voidstartCDATA()Deprecated.voidstartDocument()Deprecated.voidstartDTD(String name, String publicId, String systemId)Deprecated.voidstartElement(String namespaceURI, String localName, String qName, Attributes atts)Deprecated.voidstartEntity(String name)Deprecated.voidstartPrefixMapping(String prefix, String uri)Deprecated.voidtoSAX(ContentHandler contentHandler)Deprecated.Stream this buffer into the provided content handler.StringtoString()Deprecated.
-
-
-
Constructor Detail
-
SAXBuffer
public SAXBuffer()
Deprecated.Creates empty SaxBuffer
-
SAXBuffer
public SAXBuffer(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(String name) throws SAXException
Deprecated.- Specified by:
skippedEntityin interfaceContentHandler- Throws:
SAXException
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
Deprecated.- Specified by:
setDocumentLocatorin interfaceContentHandler
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXExceptionDeprecated.- Specified by:
ignorableWhitespacein interfaceContentHandler- Throws:
SAXException
-
processingInstruction
public void processingInstruction(String target, String data) throws SAXException
Deprecated.- Specified by:
processingInstructionin interfaceContentHandler- Throws:
SAXException
-
startDocument
public void startDocument() throws SAXExceptionDeprecated.- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
Deprecated.- Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
endPrefixMapping
public void endPrefixMapping(String prefix) throws SAXException
Deprecated.- Specified by:
endPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length) throws SAXExceptionDeprecated.- Specified by:
charactersin interfaceContentHandler- Throws:
SAXException
-
endElement
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
Deprecated.- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXExceptionDeprecated.- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
Deprecated.- Specified by:
startPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
endCDATA
public void endCDATA() throws SAXExceptionDeprecated.- Specified by:
endCDATAin interfaceLexicalHandler- Throws:
SAXException
-
comment
public void comment(char[] ch, int start, int length) throws SAXExceptionDeprecated.- Specified by:
commentin interfaceLexicalHandler- Throws:
SAXException
-
startEntity
public void startEntity(String name) throws SAXException
Deprecated.- Specified by:
startEntityin interfaceLexicalHandler- Throws:
SAXException
-
endDTD
public void endDTD() throws SAXExceptionDeprecated.- Specified by:
endDTDin interfaceLexicalHandler- Throws:
SAXException
-
startDTD
public void startDTD(String name, String publicId, String systemId) throws SAXException
Deprecated.- Specified by:
startDTDin interfaceLexicalHandler- Throws:
SAXException
-
startCDATA
public void startCDATA() throws SAXExceptionDeprecated.- Specified by:
startCDATAin interfaceLexicalHandler- Throws:
SAXException
-
endEntity
public void endEntity(String name) throws SAXException
Deprecated.- Specified by:
endEntityin interfaceLexicalHandler- Throws:
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 List<org.apache.cocoon.xml.sax.SAXBuffer.SaxBit> getBits()
Deprecated.- Returns:
- unmodifiable list of SAX bits
-
toSAX
public void toSAX(ContentHandler contentHandler) throws SAXException
Deprecated.Stream this buffer into the provided content handler. If contentHandler object implements LexicalHandler, it will get lexical events as well.- Throws:
SAXException
-
toString
public String toString()
Deprecated.
-
recycle
public void recycle()
Deprecated.Clear this buffer
-
dump
public void dump(Writer writer) throws IOException
Deprecated.Dump buffer contents into the provided writer.- Throws:
IOException
-
-