Package org.codehaus.mojo.xml.format
Class IndentCheckSaxHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.codehaus.mojo.xml.format.IndentCheckSaxHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
A
DefaultHandler implementation that detects formatting violations and reports them to the supplied
XmlFormatViolationHandler.- Author:
- Peter Palaga
-
Constructor Summary
ConstructorsConstructorDescriptionIndentCheckSaxHandler(File file, int indentSize, XmlFormatViolationHandler violationHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) Stores the passed characters into a character buffer.voidendElement(String uri, String localName, String qName) Checks indentation for an end element.voidignorableWhitespace(char[] chars, int start, int length) Just delegates tocharacters(char[], int, int), since this method is not called in all situations where it could be naively expected.resolveEntity(String publicId, String systemId) Always returns an emptyInputSourceto avoid loading of any DTDs.voidsetDocumentLocator(Locator locator) voidstartElement(String uri, String localName, String qName, Attributes attributes) Checks indentation for a start element.Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, notationDecl, processingInstruction, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
Constructor Details
-
IndentCheckSaxHandler
-
-
Method Details
-
characters
Stores the passed characters into a character buffer.- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException- See Also:
-
endElement
Checks indentation for an end element.- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException- See Also:
-
ignorableWhitespace
Just delegates tocharacters(char[], int, int), since this method is not called in all situations where it could be naively expected.- Specified by:
ignorableWhitespacein interfaceContentHandler- Overrides:
ignorableWhitespacein classDefaultHandler- Throws:
SAXException- See Also:
-
resolveEntity
Always returns an emptyInputSourceto avoid loading of any DTDs.- Specified by:
resolveEntityin interfaceEntityResolver- Overrides:
resolveEntityin classDefaultHandler- Throws:
SAXExceptionIOException- See Also:
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceContentHandler- Overrides:
setDocumentLocatorin classDefaultHandler- See Also:
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException Checks indentation for a start element.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException- See Also:
-