public class IndentCheckSaxHandler extends DefaultHandler
DefaultHandler implementation that detects formatting violations and reports them to the supplied
XmlFormatViolationHandler.| Constructor and Description |
|---|
IndentCheckSaxHandler(File file,
int indentSize,
XmlFormatViolationHandler violationHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length)
Stores the passed characters into a character buffer.
|
void |
endElement(String uri,
String localName,
String qName)
Checks indentation for an end element.
|
void |
ignorableWhitespace(char[] chars,
int start,
int length)
Just delegates to
characters(char[], int, int), since this method is not called in all situations where
it could be naively expected. |
InputSource |
resolveEntity(String publicId,
String systemId)
Always returns an empty
InputSource to avoid loading of any DTDs. |
void |
setDocumentLocator(Locator locator) |
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes)
Checks indentation for a start element.
|
endDocument, endPrefixMapping, error, fatalError, notationDecl, processingInstruction, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningpublic IndentCheckSaxHandler(File file, int indentSize, XmlFormatViolationHandler violationHandler)
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class DefaultHandlerSAXExceptionDefaultHandler.characters(char[], int, int)public void endElement(String uri, String localName, String qName) throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXExceptionDefaultHandler.startElement(java.lang.String, java.lang.String, java.lang.String,
org.xml.sax.Attributes)public void ignorableWhitespace(char[] chars,
int start,
int length)
throws SAXException
characters(char[], int, int), since this method is not called in all situations where
it could be naively expected.ignorableWhitespace in interface ContentHandlerignorableWhitespace in class DefaultHandlerSAXExceptionDefaultHandler.ignorableWhitespace(char[], int, int)public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
InputSource to avoid loading of any DTDs.resolveEntity in interface EntityResolverresolveEntity in class DefaultHandlerSAXExceptionIOExceptionDefaultHandler.resolveEntity(java.lang.String, java.lang.String)public void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlersetDocumentLocator in class DefaultHandlerDefaultHandler.setDocumentLocator(org.xml.sax.Locator)public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement in interface ContentHandlerstartElement in class DefaultHandlerSAXExceptionDefaultHandler.startElement(java.lang.String, java.lang.String, java.lang.String,
org.xml.sax.Attributes)Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.