Class HtmlSnippet

java.lang.Object
com.aoapps.tldparser.HtmlSnippet

public final class HtmlSnippet extends Object
Extracts summaries from descriptions.
  • Method Details

    • getSummary

      public static String getSummary(String summaryClass, String htmlSnippet) throws XPathExpressionException
      Displays all elements with class="summaryClass" of the provided HTML snippet. If there is no elements with this class, the entire snippet is displayed.

      This parses the HTML snippet into a DOM each invocation. For higher performance, use another mechanism to compute once and use repeatedly. This is for convenience, not performance.

      Parameters:
      summaryClass - The CSS class that marks elements to be included in summaries
      Throws:
      XPathExpressionException