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
Modifier and TypeMethodDescriptionThe default summary process will shorten the String to a maximum of 255 characters and end it with ellipses (well actually '...') if it required truncation.Like but provides more control over the summary process.
-
Method Details
-
summarise
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
Like but provides more control over the summary process.- Parameters:
xhtml
- the content to be summarised.maxLength
- the maximum length of String to returnellipses
- if true then truncated text will be ended with '...'.- Returns:
- the summarised version of the xhtml parameter
- Throws:
IllegalArgumentException
- if the maxLength is less than 4 and ellipses was true.
-