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

  • Constructor Details

  • 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

      public static int getParentSectionStartIndex(DetailNode moduleJavadoc)
      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

      public static int getNotesSectionStartIndex(DetailNode moduleJavadoc)
      Gets the start index of the Notes section.
      Parameters:
      moduleJavadoc - javadoc of module.
      Returns:
      start index.
    • 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.
    • getLiTagNode

      public static Optional<DetailNode> getLiTagNode(DetailNode htmlElement)
      Gets the node of Li HTML tag.
      Parameters:
      htmlElement - html element to get li tag from.
      Returns:
      Optional of li tag node.
    • getPropertySectionStartIndex

      public static int getPropertySectionStartIndex(DetailNode moduleJavadoc, Set<String> propertyNames)
      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

      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.