Class AbstractLoader
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- com.puppycrawl.tools.checkstyle.api.AbstractLoader
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
- Direct Known Subclasses:
PackageNamesLoader
,SuppressionsLoader
public abstract class AbstractLoader extends DefaultHandler
Contains the common implementation of a loader, for loading a configuration from an XML file.The error handling policy can be described as being austere, dead set, disciplinary, dour, draconian, exacting, firm, forbidding, grim, hard, hard- boiled, harsh, harsh, in line, iron-fisted, no-nonsense, oppressive, persnickety, picky, prudish, punctilious, puritanical, rigid, rigorous, scrupulous, set, severe, square, stern, stickler, straight, strait-laced, stringent, stuffy, stuffy, tough, unpermissive, unsparing and uptight.
- Author:
- Oliver Burn
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLoader(String publicId, String dtdResourceName)
Creates a new instance.protected
AbstractLoader(Map<String,String> publicIdToResourceNameMap)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
error(SAXParseException exception)
void
fatalError(SAXParseException exception)
void
parseInputSource(InputSource inputSource)
Parses the specified input source.InputSource
resolveEntity(String publicId, String systemId)
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
AbstractLoader
protected AbstractLoader(String publicId, String dtdResourceName) throws SAXException, ParserConfigurationException
Creates a new instance.- Parameters:
publicId
- the public ID for the DTD to resolvedtdResourceName
- the resource for the DTD- Throws:
SAXException
- if an error occursParserConfigurationException
- if an error occurs
-
AbstractLoader
protected AbstractLoader(Map<String,String> publicIdToResourceNameMap) throws SAXException, ParserConfigurationException
Creates a new instance.- Parameters:
publicIdToResourceNameMap
- maps public IDs to DTD resource names- Throws:
SAXException
- if an error occursParserConfigurationException
- if an error occurs
-
-
Method Detail
-
parseInputSource
public void parseInputSource(InputSource inputSource) throws IOException, SAXException
Parses the specified input source.- Parameters:
inputSource
- the input source to parse.- Throws:
IOException
- if an error occursSAXException
- in an error occurs
-
resolveEntity
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
- Specified by:
resolveEntity
in interfaceEntityResolver
- Overrides:
resolveEntity
in classDefaultHandler
- Throws:
SAXException
IOException
-
error
public void error(SAXParseException exception) throws SAXException
- Specified by:
error
in interfaceErrorHandler
- Overrides:
error
in classDefaultHandler
- Throws:
SAXException
-
fatalError
public void fatalError(SAXParseException exception) throws SAXException
- Specified by:
fatalError
in interfaceErrorHandler
- Overrides:
fatalError
in classDefaultHandler
- Throws:
SAXException
-
-