- java.lang.Object
-
- com.aoapps.tldparser.HtmlSnippet
-
public class HtmlSnippet extends Object
Extracts summaries from descriptions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetSummary(String summaryClass, String htmlSnippet)Displays all elements with class="summaryClass" of the provided HTML snippet.
-
-
-
Method Detail
-
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
-
-