Class XmlMetaWriter
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.meta.XmlMetaWriter
-
public final class XmlMetaWriter extends Object
Class to write module details object into an XML file.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
DEFAULT_FILE_SEPARATOR
Default(UNIX) file separator.private static Pattern
FILEPATH_CONVERSION
Compiled pattern for.
used for generating file paths from package names.private static String
XML_TAG_DESCRIPTION
Description tag of metadata XML files.private static String
XML_TAG_NAME
Name tag of metadata XML files.
-
Constructor Summary
Constructors Modifier Constructor Description private
XmlMetaWriter()
Do no allowXmlMetaWriter
instances to be created.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
createPropertySection(ModuleDetails moduleDetails, Element checkModule, Document doc)
Create the property section of the module detail object.static void
write(ModuleDetails moduleDetails)
Helper function to write module details to XML file.private static void
writeToFile(Document document, ModuleDetails moduleDetails)
Function to write the prepared document object into an XML file.
-
-
-
Field Detail
-
FILEPATH_CONVERSION
private static final Pattern FILEPATH_CONVERSION
Compiled pattern for.
used for generating file paths from package names.
-
XML_TAG_NAME
private static final String XML_TAG_NAME
Name tag of metadata XML files.- See Also:
- Constant Field Values
-
XML_TAG_DESCRIPTION
private static final String XML_TAG_DESCRIPTION
Description tag of metadata XML files.- See Also:
- Constant Field Values
-
DEFAULT_FILE_SEPARATOR
private static final String DEFAULT_FILE_SEPARATOR
Default(UNIX) file separator.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XmlMetaWriter
private XmlMetaWriter()
Do no allowXmlMetaWriter
instances to be created.
-
-
Method Detail
-
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
-
-