|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.confluence.util.ExcerptHelper
public class ExcerptHelper
Defines common functions that obtain excerpts of content (e.g. 'page children' and 'content by label' macros).
Constructor Summary | |
---|---|
ExcerptHelper()
|
Method Summary | |
---|---|
java.lang.String |
getExcerpt(ContentEntityObject contentEntityObject)
Returns the body of an excerpt macro (including any xhtml tags). |
java.lang.String |
getExcerptSummary(ContentEntityObject contentEntityObject)
Returns the first line of an excerpt macro as plain text (all xhtml tags will be stripped) |
MacroDefinition |
getMacroDefinition(ContentEntityObject contentEntityObject,
java.lang.String macroName)
Gets the first MacroDefinition in the supplied (@code contentEntityObject}. |
java.lang.String |
getText(java.lang.String content)
Returns the text from a fragment of XHTML content. |
java.lang.String |
getTextSummary(java.lang.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. |
void |
setContentTransformerFactory(ContentTransformerFactory contentTransformerFactory)
|
void |
setHtmlParagraphStripper(HTMLParagraphStripper htmlParagraphStripper)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExcerptHelper()
Method Detail |
---|
public java.lang.String getExcerpt(ContentEntityObject contentEntityObject)
contentEntityObject
- that contains the excerpt macro.
""
if there was no excerpt macro.public java.lang.String getExcerptSummary(ContentEntityObject contentEntityObject)
contentEntityObject
- that contains the excerpt macro.
""
if there was no excerpt macro.public MacroDefinition getMacroDefinition(ContentEntityObject contentEntityObject, java.lang.String macroName)
MacroDefinition
in the supplied (@code contentEntityObject}.
contentEntityObject
- (normally a Page) in which to find the macro.macroName
- the name of the macro to find.
public java.lang.String getText(java.lang.String content)
content
- the XHTML content.
public java.lang.String getTextSummary(java.lang.String content, int minLength, int maxLength)
content
- the XHTML content.minLength
- the minimum length (normally 1) character (if available).maxLength
- the maximum length (normally 100) characters.
public void setContentTransformerFactory(ContentTransformerFactory contentTransformerFactory)
public void setHtmlParagraphStripper(HTMLParagraphStripper htmlParagraphStripper)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |