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 String
A newline with 10 spaces of indentation.static final String
A newline with 12 spaces of indentation.static final String
A newline with 14 spaces of indentation.static final String
A newline with 16 spaces of indentation.static final String
A newline with 18 spaces of indentation.static final String
A newline with 20 spaces of indentation.static final String
A newline with 8 spaces of indentation.static final String
New line escape character.static final String
"Notes:" javadoc marking.static final Pattern
"Notes:" line. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<DetailNode>
getLiTagNode
(DetailNode htmlElement) Gets the node of Li HTML tag.static int
getNotesSectionStartIndex
(DetailNode moduleJavadoc) Gets the start index of the Notes section.static int
getParentSectionStartIndex
(DetailNode moduleJavadoc) Gets the starting index of the "Parent is" paragraph in module's javadoc.getPropertyNames
(String moduleName) Gets properties of the specified module.static int
getPropertySectionStartIndex
(DetailNode moduleJavadoc, Set<String> propertyNames) Gets the start index of property section in module's javadoc.private static boolean
isStartOfNotesSection
(DetailNode htmlElement) Determines whether the given HTML node marks the start of the "Notes" section.static boolean
Checks if given line starts with HTML text-formatting tag.static void
writeOutJavadocPortion
(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.
-
-
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.
-
getParentSectionStartIndex
Gets the starting index of the "Parent is" paragraph in module's javadoc.- Parameters:
moduleJavadoc
- javadoc of module.- Returns:
- start index of parent subsection.
-
getNotesSectionStartIndex
Gets the start index of the Notes section.- Parameters:
moduleJavadoc
- javadoc of module.- Returns:
- start index.
-
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.
-
getPropertySectionStartIndex
Gets the start index of property section in module's javadoc.- Parameters:
moduleJavadoc
- javadoc of module.propertyNames
- set with property names.- Returns:
- index of property section.
-
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.
-