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 ContentHandler
and LexicalHandler
are supported, the only
exception is that the setDocumentLocator event is not recorded.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated.static final class
Deprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) Deprecated.void
comment
(char[] ch, int start, int length) Deprecated.void
Deprecated.Dump buffer contents into the provided writer.void
endCDATA()
Deprecated.void
Deprecated.void
endDTD()
Deprecated.void
endElement
(String namespaceURI, String localName, String qName) Deprecated.void
Deprecated.void
endPrefixMapping
(String prefix) Deprecated.List
<org.apache.cocoon.xml.sax.SAXBuffer.SaxBit> getBits()
Deprecated.void
ignorableWhitespace
(char[] ch, int start, int length) Deprecated.boolean
isEmpty()
Deprecated.void
processingInstruction
(String target, String data) Deprecated.void
recycle()
Deprecated.Clear this buffervoid
Deprecated.Add a another buffervoid
setDocumentLocator
(Locator locator) Deprecated.void
skippedEntity
(String name) Deprecated.void
Deprecated.void
Deprecated.void
Deprecated.void
startElement
(String namespaceURI, String localName, String qName, Attributes atts) Deprecated.void
startEntity
(String name) Deprecated.void
startPrefixMapping
(String prefix, String uri) Deprecated.void
toSAX
(ContentHandler contentHandler) Deprecated.Stream this buffer into the provided content handler.toString()
Deprecated.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
SAXBuffer
public SAXBuffer()Deprecated.Creates empty SaxBuffer -
SAXBuffer
Deprecated.Creates SaxBuffer based on the provided bits list. -
SAXBuffer
Deprecated.Creates copy of another SaxBuffer
-
-
Method Details
-
skippedEntity
Deprecated.- Specified by:
skippedEntity
in interfaceContentHandler
- Throws:
SAXException
-
setDocumentLocator
Deprecated.- Specified by:
setDocumentLocator
in interfaceContentHandler
-
ignorableWhitespace
Deprecated.- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Throws:
SAXException
-
processingInstruction
Deprecated.- Specified by:
processingInstruction
in interfaceContentHandler
- Throws:
SAXException
-
startDocument
Deprecated.- Specified by:
startDocument
in interfaceContentHandler
- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException Deprecated.- Specified by:
startElement
in interfaceContentHandler
- Throws:
SAXException
-
endPrefixMapping
Deprecated.- Specified by:
endPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
characters
Deprecated.- Specified by:
characters
in interfaceContentHandler
- Throws:
SAXException
-
endElement
Deprecated.- Specified by:
endElement
in interfaceContentHandler
- Throws:
SAXException
-
endDocument
Deprecated.- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
-
startPrefixMapping
Deprecated.- Specified by:
startPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
endCDATA
Deprecated.- Specified by:
endCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
comment
Deprecated.- Specified by:
comment
in interfaceLexicalHandler
- Throws:
SAXException
-
startEntity
Deprecated.- Specified by:
startEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
endDTD
Deprecated.- Specified by:
endDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
startDTD
Deprecated.- Specified by:
startDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
startCDATA
Deprecated.- Specified by:
startCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
endEntity
Deprecated.- Specified by:
endEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
saxBuffer
Deprecated.Add a another buffer -
isEmpty
public boolean isEmpty()Deprecated.- Returns:
- true if buffer is empty
-
getBits
Deprecated.- Returns:
- unmodifiable list of SAX bits
-
toSAX
Deprecated.Stream this buffer into the provided content handler. If contentHandler object implements LexicalHandler, it will get lexical events as well.- Throws:
SAXException
-
toString
Deprecated. -
recycle
public void recycle()Deprecated.Clear this buffer -
dump
Deprecated.Dump buffer contents into the provided writer.- Throws:
IOException
-