Class XmlMetaReader


  • public final class XmlMetaReader
    extends java.lang.Object
    Class having utilities required to read module details from an XML metadata file of a module.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ModuleDetails read​(java.io.InputStream moduleMetadataStream, ModuleType moduleType)
      Read the module details from the supplied input stream of the module's XML metadata file.
      static java.util.List<ModuleDetails> readAllModulesIncludingThirdPartyIfAny​(java.lang.String... thirdPartyPackages)
      Utility to load all the metadata files present in the checkstyle JAR including third parties' module metadata files.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • readAllModulesIncludingThirdPartyIfAny

        public static java.util.List<ModuleDetails> readAllModulesIncludingThirdPartyIfAny​(java.lang.String... thirdPartyPackages)
        Utility to load all the metadata files present in the checkstyle JAR including third parties' module metadata files. checkstyle metadata files are grouped in a folder hierarchy similar to that of their corresponding source files. Third party(e.g. SevNTU Checks) metadata files are prefixed with checkstylemeta- to their file names.
        Parameters:
        thirdPartyPackages - list of fully qualified third party package names(can be only a hint, e.g. for SevNTU it can be com.github.sevntu / com.github)
        Returns:
        list of module details found in the classpath satisfying the above conditions
      • read

        public static ModuleDetails read​(java.io.InputStream moduleMetadataStream,
                                         ModuleType moduleType)
                                  throws javax.xml.parsers.ParserConfigurationException,
                                         java.io.IOException,
                                         org.xml.sax.SAXException
        Read the module details from the supplied input stream of the module's XML metadata file.
        Parameters:
        moduleMetadataStream - input stream object of a module's metadata file
        moduleType - type of module
        Returns:
        module detail object extracted from the XML metadata file
        Throws:
        javax.xml.parsers.ParserConfigurationException - if a parser configuration exception occurs
        java.io.IOException - if a IO exception occurs
        org.xml.sax.SAXException - if a SAX exception occurs during parsing the XML file