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 void
characters(char[] ch, int start, int length)
Filter out ignorable whitespace (for FileVault all elements are empty, i.e. every character is ignorable)void
comment(char[] ch, int start, int length)
void
endCDATA()
void
endDTD()
Start Lexical Handlervoid
endEntity(String name)
void
parse(InputSource input)
void
setProperty(String name, Object value)
void
startCDATA()
void
startDTD(String name, String publicId, String systemId)
void
startElement(String uri, String localName, String qName, Attributes atts)
void
startEntity(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:
setProperty
in interfaceXMLReader
- Overrides:
setProperty
in classXMLFilterImpl
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
-
parse
public void parse(InputSource input) throws SAXException, IOException
- Specified by:
parse
in interfaceXMLReader
- Overrides:
parse
in classXMLFilterImpl
- Throws:
SAXException
IOException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classXMLFilterImpl
- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length) throws SAXException
Filter out ignorable whitespace (for FileVault all elements are empty, i.e. every character is ignorable)- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classXMLFilterImpl
- Throws:
SAXException
-
startDTD
public void startDTD(String name, String publicId, String systemId) throws SAXException
- Specified by:
startDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
endDTD
public void endDTD() throws SAXException
Start Lexical Handler- Specified by:
endDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
startEntity
public void startEntity(String name) throws SAXException
- Specified by:
startEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
endEntity
public void endEntity(String name) throws SAXException
- Specified by:
endEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
startCDATA
public void startCDATA() throws SAXException
- Specified by:
startCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
endCDATA
public void endCDATA() throws SAXException
- Specified by:
endCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
comment
public void comment(char[] ch, int start, int length) throws SAXException
- Specified by:
comment
in interfaceLexicalHandler
- Throws:
SAXException
-
-