Class 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.
    • 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 org.xml.sax.helpers.DefaultHandler

        characters, endDocument, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class org.xml.sax.helpers.DefaultHandler
      • endElement

        public void endElement​(java.lang.String uri,
                               java.lang.String localName,
                               java.lang.String qName)
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class org.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.