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 intgetDescriptionEndIndex(DetailNode moduleJavadoc) Gets the end index of the description.static Optional<DetailNode>getLiTagNode(DetailNode htmlElement) Gets the node of Li HTML tag.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 intgetModuleSinceVersionTagStartIndex(DetailNode moduleJavadoc) Gets the starting index of the "@since" version tag in module's javadoc.static intgetNotesEndIndex(DetailNode moduleJavadoc) Gets the end index of the Notes.static intgetNotesSectionStartIndex(DetailNode moduleJavadoc) Gets the start index 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.
-
getLiTagNode
Gets the node of Li HTML tag.- Parameters:
htmlElement- html element to get li tag from.- Returns:
- Optional of li tag node.
-
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.
-
getDescriptionEndIndex
Gets the end index of the description.- Parameters:
moduleJavadoc- javadoc of module.- Returns:
- the end index.
-
getNotesSectionStartIndex
Gets the start index of the Notes section.- Parameters:
moduleJavadoc- javadoc of module.- Returns:
- start index.
-
getModuleSinceVersionTagStartIndex
Gets the starting index of the "@since" version tag in module's javadoc.- Parameters:
moduleJavadoc- javadoc of module.- Returns:
- start index of "@since".
-
getModuleNotes
Gets the Notes section of module from module javadoc.- Parameters:
moduleJavadoc- module javadoc.- Returns:
- Notes section of module.
-
getNotesEndIndex
Gets the end index 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.
-