Class SiteUtil.DescriptionExtractor

    • Method Detail

      • getDescriptionFromJavadoc

        private static String getDescriptionFromJavadoc​(DetailNode javadoc,
                                                        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​(StringBuilder description,
                                               String moduleName,
                                               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 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.