Class SiteUtil.DescriptionExtractor

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.String getDescriptionFromJavadoc​(DetailNode javadoc, java.lang.String moduleName)
      Extracts the description from the javadoc detail node.
      private static java.util.List<DetailNode> getDescriptionNodes​(DetailNode javadoc)
      Extracts description nodes from javadoc.
      private static void handleInternalLink​(java.lang.StringBuilder description, java.lang.String moduleName, java.lang.String value)
      Converts the href value to a relative link to the document and appends it to the description.
      private static boolean isEndOfDescription​(DetailNode child)
      Determines if the given child index is the end of the description.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getDescriptionFromJavadoc

        private static java.lang.String getDescriptionFromJavadoc​(DetailNode javadoc,
                                                                  java.lang.String moduleName)
                                                           throws org.apache.maven.doxia.macro.MacroExecutionException
        Extracts the description from the javadoc detail node. Performs a DFS traversal on the detail node and extracts the text nodes.
        Parameters:
        javadoc - the Javadoc to extract the description from.
        moduleName - the name of the module.
        Returns:
        the description of the setter.
        Throws:
        org.apache.maven.doxia.macro.MacroExecutionException - if the description could not be extracted.
      • handleInternalLink

        private static void handleInternalLink​(java.lang.StringBuilder description,
                                               java.lang.String moduleName,
                                               java.lang.String value)
                                        throws org.apache.maven.doxia.macro.MacroExecutionException
        Converts the href value to a relative link to the document and appends it to the description.
        Parameters:
        description - the description to append the relative link to.
        moduleName - the name of the module.
        value - the href value.
        Throws:
        org.apache.maven.doxia.macro.MacroExecutionException - if the relative link could not be created.
      • getDescriptionNodes

        private static java.util.List<DetailNodegetDescriptionNodes​(DetailNode javadoc)
        Extracts description nodes from javadoc.
        Parameters:
        javadoc - the Javadoc to extract the description from.
        Returns:
        the description nodes of the setter.
      • isEndOfDescription

        private static boolean isEndOfDescription​(DetailNode child)
        Determines if the given child index is the end of the description. The end of the description is defined as 4 consecutive nodes of type NEWLINE, LEADING_ASTERISK, NEWLINE, LEADING_ASTERISK. This is an asterisk that is alone on a line. Just like the one below this line.
        Parameters:
        child - the child to check.
        Returns:
        true if the given child index is the end of the description.