Package com.puppycrawl.tools.checkstyle
Class ConfigurationLoader.InternalLoader
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- com.puppycrawl.tools.checkstyle.XmlLoader
-
- com.puppycrawl.tools.checkstyle.ConfigurationLoader.InternalLoader
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
- Enclosing class:
- ConfigurationLoader
private final class ConfigurationLoader.InternalLoader extends XmlLoader
Implements the SAX document handler interfaces, so they do not appear in the public API of the ConfigurationLoader.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.XmlLoader
XmlLoader.LoadExternalDtdFeatureProvider
-
-
Field Summary
Fields Modifier and Type Field Description private Deque<DefaultConfiguration>
configStack
The loaded configurations.private Configuration
configuration
The Configuration that is being built.private static String
DEFAULT
Default attribute.private static String
KEY
Name of the key attribute.private static String
MESSAGE
Name of the message element.private static String
METADATA
Name of the message element.private static String
MODULE
Module elements.private static String
NAME
Name attribute.private static String
PROPERTY
Property element.private static String
SEVERITY
Name of the severity property.private static String
VALUE
Value attribute.
-
Constructor Summary
Constructors Modifier Constructor Description private
InternalLoader()
Creates a new InternalLoader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
containsAttribute(Configuration module, String attributeName)
Util method to recheck attribute in module.void
endElement(String uri, String localName, String qName)
void
startElement(String uri, 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, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Field Detail
-
MODULE
private static final String MODULE
Module elements.- See Also:
- Constant Field Values
-
NAME
private static final String NAME
Name attribute.- See Also:
- Constant Field Values
-
PROPERTY
private static final String PROPERTY
Property element.- See Also:
- Constant Field Values
-
VALUE
private static final String VALUE
Value attribute.- See Also:
- Constant Field Values
-
DEFAULT
private static final String DEFAULT
Default attribute.- See Also:
- Constant Field Values
-
SEVERITY
private static final String SEVERITY
Name of the severity property.- See Also:
- Constant Field Values
-
MESSAGE
private static final String MESSAGE
Name of the message element.- See Also:
- Constant Field Values
-
METADATA
private static final String METADATA
Name of the message element.- See Also:
- Constant Field Values
-
KEY
private static final String KEY
Name of the key attribute.- See Also:
- Constant Field Values
-
configStack
private final Deque<DefaultConfiguration> configStack
The loaded configurations.
-
configuration
private Configuration configuration
The Configuration that is being built.
-
-
Constructor Detail
-
InternalLoader
private InternalLoader() throws SAXException, ParserConfigurationException
Creates a new InternalLoader.- Throws:
SAXException
- if an error occursParserConfigurationException
- if an error occurs
-
-
Method Detail
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Throws:
SAXException
-
containsAttribute
private boolean containsAttribute(Configuration module, String attributeName)
Util method to recheck attribute in module.- Parameters:
module
- module to checkattributeName
- name of attribute in module to find- Returns:
- true if attribute is present in module
-
-