com.atlassian.confluence.content.render.xhtml.storage
Interface Summariser

All Known Implementing Classes:
DefaultSummariser

public interface Summariser

Summarise storage format XHTML making it suitable for display where a short summary of the content is required. For example, the PageNotFoundAction provides a short summary of possible alternative pages and will make use of an implementation of the Summariser.

It must be remembered that the Summariser will not automatically ensure the returned String is encoded for safe use. Encoding for display is a function of the client of the Summariser component.

Since:
4.0

Method Summary
 java.lang.String summarise(java.lang.String xhtml)
          The default summary process will shorten the String to a maximum of 255 characters and end it with ellipses (well actually '...') if it required truncation.
 java.lang.String summarise(java.lang.String xhtml, int maxLength, boolean ellipses)
          Like summarise(String) but provides more control over the summary process.
 

Method Detail

summarise

java.lang.String summarise(java.lang.String xhtml)
The default summary process will shorten the String to a maximum of 255 characters and end it with ellipses (well actually '...') if it required truncation.

Parameters:
xhtml - the content to be summarised.
Returns:
a summary of the supplied XHTML content which is no longer than 255 characters.

summarise

java.lang.String summarise(java.lang.String xhtml,
                           int maxLength,
                           boolean ellipses)
Like summarise(String) but provides more control over the summary process.

Parameters:
xhtml - the content to be summarised.
maxLength - the maximum length of String to return
ellipses - if true then truncated text will be ended with '...'.
Returns:
the summarised version of the xhtml parameter
Throws:
java.lang.IllegalArgumentException - if the maxLength is less than 4 and ellipses was true.


Copyright © 2003-2014 Atlassian. All Rights Reserved.