Class ModuleJavadocParsingUtil
java.lang.Object
com.puppycrawl.tools.checkstyle.site.ModuleJavadocParsingUtil
Utility class for parsing javadocs of modules.
-
Field Summary
FieldsModifier and TypeFieldDescriptionA set of all html tags that need to be considered as text formatting for this macro.static final StringA newline with 10 spaces of indentation.static final StringA newline with 12 spaces of indentation.static final StringA newline with 14 spaces of indentation.static final StringA newline with 16 spaces of indentation.static final StringA newline with 18 spaces of indentation.static final StringA newline with 20 spaces of indentation.static final StringA newline with 8 spaces of indentation.static final StringNew line escape character.static final String"Notes:" javadoc marking.static final Pattern"Notes:" line.static final Pattern"Notes:" line with new line accounted. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DetailNodegetDescriptionEndNode(DetailNode moduleJavadoc) Gets the end node of the description.static StringgetModuleDescription(DetailNode moduleJavadoc) Gets the description of module from module javadoc.static StringgetModuleNotes(DetailNode moduleJavadoc) Gets the Notes section of module from module javadoc.static DetailNodegetModuleSinceVersionTagStartNode(DetailNode moduleJavadoc) Gets the node representing the start of the@sinceversion tag in the module's Javadoc.static DetailNodegetNotesEndNode(DetailNode moduleJavadoc) Gets the end node of the Notes.static DetailNodegetNotesSectionStartNode(DetailNode moduleJavadoc) Gets the start node of the Notes section.getPropertyNames(String moduleName) Gets properties of the specified module.static booleanisPropertySpecialTokenProp(Field propertyField) Checks whether property is to contain tokens.private static booleanisStartOfNotesSection(DetailNode htmlElement) Determines whether the given HTML node marks the start of the "Notes" section.static booleanChecks if given line starts with HTML text-formatting tag.static voidwriteOutJavadocPortion(String javadocPortion, org.apache.maven.doxia.sink.Sink sink) Writes the given javadoc chunk into xdoc.
-
Field Details
-
NEWLINE
New line escape character. -
INDENT_LEVEL_8
A newline with 8 spaces of indentation. -
INDENT_LEVEL_10
A newline with 10 spaces of indentation. -
INDENT_LEVEL_12
A newline with 12 spaces of indentation. -
INDENT_LEVEL_14
A newline with 14 spaces of indentation. -
INDENT_LEVEL_16
A newline with 16 spaces of indentation. -
INDENT_LEVEL_18
A newline with 18 spaces of indentation. -
INDENT_LEVEL_20
A newline with 20 spaces of indentation. -
HTML_TEXT_FORMAT_TAGS
A set of all html tags that need to be considered as text formatting for this macro. -
NOTES
"Notes:" javadoc marking.- See Also:
-
NOTES_LINE
"Notes:" line. -
NOTES_LINE_WITH_NEWLINE
"Notes:" line with new line accounted.
-
-
Constructor Details
-
ModuleJavadocParsingUtil
private ModuleJavadocParsingUtil()Private utility constructor.
-
-
Method Details
-
getPropertyNames
public static Set<String> getPropertyNames(String moduleName) throws org.apache.maven.doxia.macro.MacroExecutionException Gets properties of the specified module.- Parameters:
moduleName- name of module.- Returns:
- set of properties name if present, otherwise null.
- Throws:
org.apache.maven.doxia.macro.MacroExecutionException- if the module could not be retrieved.
-
isStartOfNotesSection
Determines whether the given HTML node marks the start of the "Notes" section.- Parameters:
htmlElement- html element to check.- Returns:
- true if the element starts the "Notes" section, false otherwise.
-
writeOutJavadocPortion
public static void writeOutJavadocPortion(String javadocPortion, org.apache.maven.doxia.sink.Sink sink) Writes the given javadoc chunk into xdoc.- Parameters:
javadocPortion- javadoc text.sink- sink of the macro.
-
startsWithTextFormattingHtmlTag
Checks if given line starts with HTML text-formatting tag.- Parameters:
line- line to check on.- Returns:
- whether given line starts with HTML text-formatting tag.
-
getModuleDescription
Gets the description of module from module javadoc.- Parameters:
moduleJavadoc- module javadoc.- Returns:
- module description.
-
getDescriptionEndNode
Gets the end node of the description.- Parameters:
moduleJavadoc- javadoc of module.- Returns:
- the end index.
-
getNotesSectionStartNode
Gets the start node of the Notes section.- Parameters:
moduleJavadoc- javadoc of module.- Returns:
- start node.
-
getModuleSinceVersionTagStartNode
Gets the node representing the start of the@sinceversion tag in the module's Javadoc.- Parameters:
moduleJavadoc- the root Javadoc node of the module- Returns:
- the
@sincetag start node, ornullif not found
-
getModuleNotes
Gets the Notes section of module from module javadoc.- Parameters:
moduleJavadoc- module javadoc.- Returns:
- Notes section of module.
-
getNotesEndNode
Gets the end node of the Notes.- Parameters:
moduleJavadoc- javadoc of module.- Returns:
- the end index.
-
isPropertySpecialTokenProp
Checks whether property is to contain tokens.- Parameters:
propertyField- property field.- Returns:
- true if property is to contain tokens, false otherwise.
-