Class ContentExcerptUtils
- java.lang.Object
-
- com.atlassian.confluence.content.render.xhtml.ContentExcerptUtils
-
public final class ContentExcerptUtils extends Object
Defines common functions that obtain excerpts of content (e.g. 'page children' and 'content by label' macros).
-
-
Constructor Summary
Constructors Constructor Description ContentExcerptUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
extractTextFromXhtmlContent(String content)
Returns the text from a fragment of XHTML content.static String
extractTextSummaryFromXhtmlContent(String content, int minLength, int maxLength)
Returns the text from the tag in the content (such as a heading or paragraph), unless its to short in which case text from the following tags are also included.
-
-
-
Method Detail
-
extractTextFromXhtmlContent
public static String extractTextFromXhtmlContent(String content)
Returns the text from a fragment of XHTML content.- Parameters:
content
- the XHTML content.- Returns:
- a value that contains only text.
-
extractTextSummaryFromXhtmlContent
public static String extractTextSummaryFromXhtmlContent(String content, int minLength, int maxLength)
Returns the text from the tag in the content (such as a heading or paragraph), unless its to short in which case text from the following tags are also included.- Parameters:
content
- the XHTML content.minLength
- the minimum length (normally 1) character (if available).maxLength
- the maximum length (normally 100) characters.- Returns:
- a value that contains only text.
-
-