Class XmlMetaWriter
java.lang.Object
com.puppycrawl.tools.checkstyle.meta.XmlMetaWriter
Class to write module details object into an XML file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringDefault(UNIX) file separator.private static final PatternCompiled pattern for.used for generating file paths from package names.private static final StringDescription tag of metadata XML files.private static final StringName tag of metadata XML files. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDo no allowXmlMetaWriterinstances to be created. -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidcreatePropertySection(ModuleDetails moduleDetails, Element checkModule, Document doc) Create the property section of the module detail object.static voidwrite(ModuleDetails moduleDetails) Helper function to write module details to XML file.private static voidwriteToFile(Document document, ModuleDetails moduleDetails) Function to write the prepared document object into an XML file.
-
Field Details
-
FILEPATH_CONVERSION
Compiled pattern for.used for generating file paths from package names. -
XML_TAG_NAME
Name tag of metadata XML files.- See Also:
-
XML_TAG_DESCRIPTION
Description tag of metadata XML files.- See Also:
-
DEFAULT_FILE_SEPARATOR
Default(UNIX) file separator.- See Also:
-
-
Constructor Details
-
XmlMetaWriter
private XmlMetaWriter()Do no allowXmlMetaWriterinstances to be created.
-
-
Method Details
-
write
public static void write(ModuleDetails moduleDetails) throws TransformerException, ParserConfigurationException Helper function to write module details to XML file.- Parameters:
moduleDetails- module details- Throws:
TransformerException- if a transformer exception occursParserConfigurationException- if a parser configuration exception occurs
-
createPropertySection
private static void createPropertySection(ModuleDetails moduleDetails, Element checkModule, Document doc) Create the property section of the module detail object.- Parameters:
moduleDetails- module detailscheckModule- root doc elementdoc- document object
-
writeToFile
private static void writeToFile(Document document, ModuleDetails moduleDetails) throws TransformerException Function to write the prepared document object into an XML file.- Parameters:
document- document updated with all module metadatamoduleDetails- the corresponding module details object- Throws:
TransformerException- if a transformer exception occurs
-