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 voidcharacters(char[] array, int start, int length)voidcomment(char[] array, int start, int length)voidendCDATA()voidendElement(String uri, String localName, String qName)voidstartCDATA()voidstartElement(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:
charactersin interfaceContentHandler- Overrides:
charactersin 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:
startElementin interfaceContentHandler- Overrides:
startElementin 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:
endElementin interfaceContentHandler- Overrides:
endElementin 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:
commentin interfaceLexicalHandler- Overrides:
commentin classDefaultXMLFilter- Throws:
SAXException
-
startCDATA
public void startCDATA() throws SAXException- Specified by:
startCDATAin interfaceLexicalHandler- Overrides:
startCDATAin classDefaultXMLFilter- Throws:
SAXException
-
endCDATA
public void endCDATA() throws SAXException- Specified by:
endCDATAin interfaceLexicalHandler- Overrides:
endCDATAin classDefaultXMLFilter- Throws:
SAXException
-
-