Class AccumulationXMLFilter
- java.lang.Object
-
- org.xml.sax.helpers.XMLFilterImpl
-
- org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter
-
- org.xwiki.rendering.wikimodel.xhtml.filter.AccumulationXMLFilter
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
,LexicalHandler
,XMLFilter
,XMLReader
public class AccumulationXMLFilter extends DefaultXMLFilter
SAX parsers are allowed to call the characters() method several times in a row. Some parsers have a buffer of 8K (Crimson), others of 16K (Xerces) and others can even call onCharacters() for every single characters! Thus we need to accumulate the characters in a buffer before we process them. This filter does exactly this.- Since:
- 4.0M1
- Version:
- $Id: d83fd2e3d7cfa9895dfda6a6365ac76fcaf2e957 $
-
-
Field Summary
-
Fields inherited from class org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter
SAX_LEXICAL_HANDLER_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description AccumulationXMLFilter()
AccumulationXMLFilter(XMLReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] array, int start, int length)
void
comment(char[] array, int start, int length)
void
endCDATA()
void
endElement(String uri, String localName, String qName)
void
startCDATA()
void
startElement(String uri, String localName, String qName, Attributes attributes)
-
Methods inherited from class org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter
endDTD, endEntity, getProperty, parse, setProperty, startDTD, startEntity
-
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, ignorableWhitespace, notationDecl, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
AccumulationXMLFilter
public AccumulationXMLFilter()
-
AccumulationXMLFilter
public AccumulationXMLFilter(XMLReader reader)
-
-
Method Detail
-
characters
public void characters(char[] array, int start, int length) throws SAXException
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classXMLFilterImpl
- Throws:
SAXException
- See Also:
DefaultHandler.characters(char[], int, int)
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classXMLFilterImpl
- Throws:
SAXException
- See Also:
DefaultHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classXMLFilterImpl
- Throws:
SAXException
- See Also:
DefaultHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
-
comment
public void comment(char[] array, int start, int length) throws SAXException
- Specified by:
comment
in interfaceLexicalHandler
- Overrides:
comment
in classDefaultXMLFilter
- Throws:
SAXException
-
startCDATA
public void startCDATA() throws SAXException
- Specified by:
startCDATA
in interfaceLexicalHandler
- Overrides:
startCDATA
in classDefaultXMLFilter
- Throws:
SAXException
-
endCDATA
public void endCDATA() throws SAXException
- Specified by:
endCDATA
in interfaceLexicalHandler
- Overrides:
endCDATA
in classDefaultXMLFilter
- Throws:
SAXException
-
-