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:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.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 java.util.Deque<DefaultConfiguration>
configStack
The loaded configurations.private Configuration
configuration
The Configuration that is being built.private static java.lang.String
DEFAULT
Default attribute.private static java.lang.String
KEY
Name of the key attribute.private static java.lang.String
MESSAGE
Name of the message element.private static java.lang.String
METADATA
Name of the message element.private static java.lang.String
MODULE
Module elements.private static java.lang.String
NAME
Name attribute.private static java.lang.String
PROPERTY
Property element.private static java.lang.String
SEVERITY
Name of the severity property.private static java.lang.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, java.lang.String attributeName)
Util method to recheck attribute in module.void
endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
void
startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
-
Methods inherited from class com.puppycrawl.tools.checkstyle.XmlLoader
error, parseInputSource, resolveEntity
-
-
-
-
Field Detail
-
MODULE
private static final java.lang.String MODULE
Module elements.- See Also:
- Constant Field Values
-
NAME
private static final java.lang.String NAME
Name attribute.- See Also:
- Constant Field Values
-
PROPERTY
private static final java.lang.String PROPERTY
Property element.- See Also:
- Constant Field Values
-
VALUE
private static final java.lang.String VALUE
Value attribute.- See Also:
- Constant Field Values
-
DEFAULT
private static final java.lang.String DEFAULT
Default attribute.- See Also:
- Constant Field Values
-
SEVERITY
private static final java.lang.String SEVERITY
Name of the severity property.- See Also:
- Constant Field Values
-
MESSAGE
private static final java.lang.String MESSAGE
Name of the message element.- See Also:
- Constant Field Values
-
METADATA
private static final java.lang.String METADATA
Name of the message element.- See Also:
- Constant Field Values
-
KEY
private static final java.lang.String KEY
Name of the key attribute.- See Also:
- Constant Field Values
-
configStack
private final java.util.Deque<DefaultConfiguration> configStack
The loaded configurations.
-
configuration
private Configuration configuration
The Configuration that is being built.
-
-
Constructor Detail
-
InternalLoader
private InternalLoader() throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
Creates a new InternalLoader.- Throws:
org.xml.sax.SAXException
- if an error occursjavax.xml.parsers.ParserConfigurationException
- if an error occurs
-
-
Method Detail
-
startElement
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
containsAttribute
private boolean containsAttribute(Configuration module, java.lang.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
-
-