Class BufferedDocumentContentHandler<Document extends BufferedDocument>
java.lang.Object
org.xml.sax.helpers.DefaultHandler
fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocumentContentHandler<Document>
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
- Direct Known Subclasses:
TransformedBufferedDocumentContentHandler
public class BufferedDocumentContentHandler<Document extends BufferedDocument>
extends DefaultHandler
SAX Content Handler which build a
BufferedDocument from the XML source stream.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidcharacters(char[] ch, int start, int length) protected DocumentvoiddoEndElement(String uri, String localName, String name) booleandoStartElement(String uri, String localName, String name, Attributes attributes) final voidendElement(String uri, String localName, String name) protected BufferedElementfindParentElementInfo(BufferedElement elementInfo, List<String> names) protected BufferedElementfindParentElementInfo(List<String> names) protected voidflushCharacters(String characters) intprotected booleanprotected voidprintEscaped(String source, IBufferedRegion region) protected voidvoidfinal voidstartElement(String uri, String localName, String name, Attributes attributes) voidstartPrefixMapping(String prefix, String uri) static AttributesImpltoAttributesImpl(Attributes attributes) Get the SAXAttributesImplof teh given attributes to modify attribute values.Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
CDATA_TYPE
- See Also:
-
bufferedDocument
-
-
Constructor Details
-
BufferedDocumentContentHandler
public BufferedDocumentContentHandler()
-
-
Method Details
-
createDocument
-
getBufferedDocument
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classDefaultHandler- Throws:
SAXException
-
startElement
public final void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
getCurrentElement
-
findParentElementInfo
-
findParentElementInfo
-
doStartElement
public boolean doStartElement(String uri, String localName, String name, Attributes attributes) throws SAXException - Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
doEndElement
- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
mustEncodeCharachers
protected boolean mustEncodeCharachers() -
flushCharacters
-
resetCharacters
protected void resetCharacters() -
toAttributesImpl
Get the SAXAttributesImplof teh given attributes to modify attribute values.- Parameters:
attributes-- Returns:
-
printEscaped
-
getElementIndex
public int getElementIndex()
-