Class NormalizingSaxFilter
- java.lang.Object
-
- org.xml.sax.helpers.XMLFilterImpl
-
- org.apache.jackrabbit.vault.util.xml.serialize.NormalizingSaxFilter
-
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler,LexicalHandler,XMLFilter,XMLReader
public class NormalizingSaxFilter extends XMLFilterImpl implements LexicalHandler
SAX filter which- orders attributes alphabetically
- strips ignorable whitespace (works even without schema/DTD: all characters in FileVault can be stripped because all elements are supposed to be empty)
- removes leading comments (prior to root element) due to bug in SAX2StAXStreamWriter in Java
-
-
Constructor Summary
Constructors Constructor Description NormalizingSaxFilter(XMLReader parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)Filter out ignorable whitespace (for FileVault all elements are empty, i.e. every character is ignorable)voidcomment(char[] ch, int start, int length)voidendCDATA()voidendDTD()Start Lexical HandlervoidendEntity(String name)voidparse(InputSource input)voidsetProperty(String name, Object value)voidstartCDATA()voidstartDTD(String name, String publicId, String systemId)voidstartElement(String uri, String localName, String qName, Attributes atts)voidstartEntity(String name)-
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, endElement, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
NormalizingSaxFilter
public NormalizingSaxFilter(XMLReader parent)
-
-
Method Detail
-
setProperty
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
- Specified by:
setPropertyin interfaceXMLReader- Overrides:
setPropertyin classXMLFilterImpl- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
parse
public void parse(InputSource input) throws SAXException, IOException
- Specified by:
parsein interfaceXMLReader- Overrides:
parsein classXMLFilterImpl- Throws:
SAXExceptionIOException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classXMLFilterImpl- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length) throws SAXExceptionFilter out ignorable whitespace (for FileVault all elements are empty, i.e. every character is ignorable)- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classXMLFilterImpl- Throws:
SAXException
-
startDTD
public void startDTD(String name, String publicId, String systemId) throws SAXException
- Specified by:
startDTDin interfaceLexicalHandler- Throws:
SAXException
-
endDTD
public void endDTD() throws SAXExceptionStart Lexical Handler- Specified by:
endDTDin interfaceLexicalHandler- Throws:
SAXException
-
startEntity
public void startEntity(String name) throws SAXException
- Specified by:
startEntityin interfaceLexicalHandler- Throws:
SAXException
-
endEntity
public void endEntity(String name) throws SAXException
- Specified by:
endEntityin interfaceLexicalHandler- Throws:
SAXException
-
startCDATA
public void startCDATA() throws SAXException- Specified by:
startCDATAin interfaceLexicalHandler- Throws:
SAXException
-
endCDATA
public void endCDATA() throws SAXException- Specified by:
endCDATAin interfaceLexicalHandler- Throws:
SAXException
-
comment
public void comment(char[] ch, int start, int length) throws SAXException- Specified by:
commentin interfaceLexicalHandler- Throws:
SAXException
-
-