Class XmlMetaReader
java.lang.Object
com.puppycrawl.tools.checkstyle.meta.XmlMetaReader
Class having utilities required to read module details from an XML metadata file of a module.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ModuleDetails
read
(InputStream moduleMetadataStream, ModuleType moduleType) Read the module details from the supplied input stream of the module's XML metadata file.static List<ModuleDetails>
readAllModulesIncludingThirdPartyIfAny
(String... thirdPartyPackages) Utility to load all the metadata files present in the checkstyle JAR including third parties' module metadata files.
-
Method Details
-
readAllModulesIncludingThirdPartyIfAny
public static List<ModuleDetails> readAllModulesIncludingThirdPartyIfAny(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 withcheckstylemeta-
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(InputStream moduleMetadataStream, ModuleType moduleType) throws ParserConfigurationException, IOException, 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 filemoduleType
- type of module- Returns:
- module detail object extracted from the XML metadata file
- Throws:
ParserConfigurationException
- if a parser configuration exception occursIOException
- if a IO exception occursSAXException
- if a SAX exception occurs during parsing the XML file
-