Class ListViewerContext

  • Direct Known Subclasses:
    TableViewerContext, ValueListViewerContext

    public class ListViewerContext
    extends TextContext
    Represents the list viewer in the Console which can display simple lists of text data.

    The list viewer in the Console interprets the data of a Log Entry as a list. Every line in the text data is interpreted as one item of the list. This class takes care of the necessary formatting and escaping required by the corresponding list viewer in the Console.

    You can use the ListViewerContext class for creating custom log methods around logCustomContext for sending custom data organized as simple lists.

    This class is not guaranteed to be threadsafe.

    • Constructor Detail

      • ListViewerContext

        public ListViewerContext()
        Overloaded. Creates and initializes a ListViewerContext instance.
      • ListViewerContext

        protected ListViewerContext​(ViewerId vi)
        Overloaded. Creates and initializes a ListViewerContext instance using a different viewer ID. This constructor is intended for derived classes, such as the ValueListViewerContext class, which extend the capabilities of this class and use a different viewer ID.
        Parameters:
        vi - The viewer ID to use.
    • Method Detail

      • escapeLine

        protected String escapeLine​(String line)
        Overridden. Escapes a line. This method ensures that the escaped line does not contain any newline characters, such as the carriage return or linefeed characters.
        Overrides:
        escapeLine in class TextContext
        Parameters:
        line - The line to escape.
        Returns:
        The escaped line.
      • escapeLine

        protected static String escapeLine​(String line,
                                           String toEscape)
        Escapes a line. This method ensures that the escaped line does not contain characters listed in the toEscape parameter plus any newline characters, such as the carriage return or linefeed characters.
        Parameters:
        line - The line to escape.
        toEscape - A set of characters which should be escaped in addition to the newline characters. Can be null or empty.
        Returns:
        The escaped line.