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, warning
public IndentCheckSaxHandler(File file, int indentSize, XmlFormatViolationHandler violationHandler)
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
SAXException
DefaultHandler.characters(char[], int, int)
public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException
DefaultHandler.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 ContentHandler
ignorableWhitespace
in class DefaultHandler
SAXException
DefaultHandler.ignorableWhitespace(char[], int, int)
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
InputSource
to avoid loading of any DTDs.resolveEntity
in interface EntityResolver
resolveEntity
in class DefaultHandler
SAXException
IOException
DefaultHandler.resolveEntity(java.lang.String, java.lang.String)
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class DefaultHandler
DefaultHandler.setDocumentLocator(org.xml.sax.Locator)
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
DefaultHandler.startElement(java.lang.String, java.lang.String, java.lang.String,
org.xml.sax.Attributes)
Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.