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:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.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.LoadExternalDtdFeatureProvider
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
static java.util.Set<java.lang.String>
getPackageNames(java.lang.ClassLoader classLoader)
Returns the set of package names, compiled from all checkstyle_packages.xml files found on the given class loaders classpath.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
-
-
-
-
Method Detail
-
startElement
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classorg.xml.sax.helpers.DefaultHandler
-
endElement
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classorg.xml.sax.helpers.DefaultHandler
-
getPackageNames
public static java.util.Set<java.lang.String> getPackageNames(java.lang.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.
-
-