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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String summarise​(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.
      String summarise​(String xhtml, int maxLength, boolean ellipses)
      Like {@see #summarise(String)} but provides more control over the summary process.
    • Method Detail

      • summarise

        String summarise​(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

        String summarise​(String xhtml,
                         int maxLength,
                         boolean ellipses)
        Like {@see #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:
        IllegalArgumentException - if the maxLength is less than 4 and ellipses was true.