Package com.puppycrawl.tools.checkstyle
Class PackageNamesLoader
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- com.puppycrawl.tools.checkstyle.XmlLoader
-
- com.puppycrawl.tools.checkstyle.PackageNamesLoader
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
public final class PackageNamesLoader extends XmlLoader
Loads a list of package names from a package name XML file.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.XmlLoader
XmlLoader.FeaturesForVerySecureJavaInstallations
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endElement(String uri, String localName, String qName)
static Set<String>
getPackageNames(ClassLoader classLoader)
Returns the set of package names, compiled from all checkstyle_packages.xml files found on the given class loaders classpath.void
startElement(String uri, String localName, String qName, Attributes attributes)
-
Methods inherited from class com.puppycrawl.tools.checkstyle.XmlLoader
error, fatalError, parseInputSource, resolveEntity
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Method Detail
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes)
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
-
endElement
public void endElement(String uri, String localName, String qName)
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
-
getPackageNames
public static Set<String> getPackageNames(ClassLoader classLoader) throws CheckstyleException
Returns the set of package names, compiled from all checkstyle_packages.xml files found on the given class loaders classpath.- Parameters:
classLoader
- the class loader for loading the checkstyle_packages.xml files.- Returns:
- the set of package names.
- Throws:
CheckstyleException
- if an error occurs.
-
-