Class ModuleJavadocParsingUtil

java.lang.Object
com.puppycrawl.tools.checkstyle.site.ModuleJavadocParsingUtil

public final class ModuleJavadocParsingUtil extends Object
Utility class for parsing javadocs of modules.
  • Field Details

    • NEWLINE

      public static final String NEWLINE
      New line escape character.
    • INDENT_LEVEL_4

      public static final String INDENT_LEVEL_4
      A newline with 4 spaces of indentation.
    • INDENT_LEVEL_6

      public static final String INDENT_LEVEL_6
      A newline with 6 spaces of indentation.
    • INDENT_LEVEL_8

      public static final String INDENT_LEVEL_8
      A newline with 8 spaces of indentation.
    • INDENT_LEVEL_10

      public static final String INDENT_LEVEL_10
      A newline with 10 spaces of indentation.
    • INDENT_LEVEL_12

      public static final String INDENT_LEVEL_12
      A newline with 12 spaces of indentation.
    • INDENT_LEVEL_14

      public static final String INDENT_LEVEL_14
      A newline with 14 spaces of indentation.
    • INDENT_LEVEL_16

      public static final String INDENT_LEVEL_16
      A newline with 16 spaces of indentation.
    • INDENT_LEVEL_18

      public static final String INDENT_LEVEL_18
      A newline with 18 spaces of indentation.
    • INDENT_LEVEL_20

      public static final String INDENT_LEVEL_20
      A newline with 20 spaces of indentation.
    • HTML_TEXT_FORMAT_TAGS

      public static final Set<String> HTML_TEXT_FORMAT_TAGS
      A set of all html tags that need to be considered as text formatting for this macro.
    • NOTES

      public static final String NOTES
      "Notes:" javadoc marking.
      See Also:
    • NOTES_LINE

      public static final Pattern NOTES_LINE
      "Notes:" line.
    • NOTES_LINE_WITH_NEWLINE

      public static final Pattern 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

      private static boolean isStartOfNotesSection(DetailNode htmlElement)
      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

      public static boolean startsWithTextFormattingHtmlTag(String line)
      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

      public static String getModuleDescription(DetailNode moduleJavadoc)
      Gets the description of module from module javadoc.
      Parameters:
      moduleJavadoc - module javadoc.
      Returns:
      module description.
    • getModuleSinceVersion

      public static String getModuleSinceVersion(DetailNode moduleJavadoc)
      Gets the @since version of module from module javadoc.
      Parameters:
      moduleJavadoc - module javadoc
      Returns:
      module @since version. For instance, 8.0
    • getDescriptionEndNode

      public static DetailNode getDescriptionEndNode(DetailNode moduleJavadoc)
      Gets the end node of the description.
      Parameters:
      moduleJavadoc - javadoc of module.
      Returns:
      the end index.
    • getNotesSectionStartNode

      public static DetailNode getNotesSectionStartNode(DetailNode moduleJavadoc)
      Gets the start node of the Notes section.
      Parameters:
      moduleJavadoc - javadoc of module.
      Returns:
      start node.
    • getModuleSinceVersionTagStartNode

      public static DetailNode getModuleSinceVersionTagStartNode(DetailNode moduleJavadoc)
      Gets the node representing the start of the @since version tag in the module's Javadoc.
      Parameters:
      moduleJavadoc - the root Javadoc node of the module
      Returns:
      the @since tag start node, or null if not found
    • getNodeBeforeJavadocTags

      public static DetailNode getNodeBeforeJavadocTags(DetailNode moduleJavadoc)
      Gets the node of module's javadoc whose next sibling is a node that defines a javadoc tag.
      Parameters:
      moduleJavadoc - the root Javadoc node of the module
      Returns:
      the node that precedes node defining javadoc tag if present, otherwise just the last node of module's javadoc.
    • getModuleNotes

      public static String getModuleNotes(DetailNode moduleJavadoc)
      Gets the Notes section of module from module javadoc.
      Parameters:
      moduleJavadoc - module javadoc.
      Returns:
      Notes section of module.
    • isPropertySpecialTokenProp

      public static boolean isPropertySpecialTokenProp(Field propertyField)
      Checks whether property is to contain tokens.
      Parameters:
      propertyField - property field.
      Returns:
      true if property is to contain tokens, false otherwise.