Class SuppressionsLoader
java.lang.Object
org.xml.sax.helpers.DefaultHandler
com.puppycrawl.tools.checkstyle.XmlLoader
com.puppycrawl.tools.checkstyle.filters.SuppressionsLoader
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
Loads a filter chain of suppressions.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.XmlLoader
XmlLoader.LoadExternalDtdFeatureProvider
-
Method Summary
Modifier and TypeMethodDescriptionstatic FilterSet
loadSuppressions
(String filename) Returns the suppression filters in a specified file.static Set<TreeWalkerFilter>
loadXpathSuppressions
(String filename) Returns the suppressionTreeWalker
filters in a specified file.void
startElement
(String namespaceUri, String localName, String qName, Attributes attributes) Methods inherited from class com.puppycrawl.tools.checkstyle.XmlLoader
error, parseInputSource, resolveEntity
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Method Details
-
startElement
public void startElement(String namespaceUri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
loadSuppressions
Returns the suppression filters in a specified file.- Parameters:
filename
- name of the suppressions file.- Returns:
- the filter chain of suppression elements specified in the file.
- Throws:
CheckstyleException
- if an error occurs.
-
loadXpathSuppressions
public static Set<TreeWalkerFilter> loadXpathSuppressions(String filename) throws CheckstyleException Returns the suppressionTreeWalker
filters in a specified file.- Parameters:
filename
- name of the suppressions file.- Returns:
- the set of xpath suppression elements specified in the file.
- Throws:
CheckstyleException
- if an error occurs.
-