Class ValueListViewerContext

  • Direct Known Subclasses:
    InspectorViewerContext

    public class ValueListViewerContext
    extends ListViewerContext
    Represents the value list viewer in the Console which can display data as a key/value list.

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

    You can use the ValueListViewerContext class for creating custom log methods around logCustomContext for sending custom data organized as key/value lists.

    This class is not guaranteed to be thread safe.

    • Constructor Detail

      • ValueListViewerContext

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

        protected ValueListViewerContext​(ViewerId vi)
        Overloaded. Creates and initializes a ValueListViewerContext instance using a different viewer ID.

        This constructor is intended for derived classes, such as the InspectorViewerContext class, which extend the capabilities of this class and use a different viewer ID.

        Parameters:
        vi - The viewer ID to use
    • Method Detail

      • appendKeyValue

        public void appendKeyValue​(String key,
                                   String value)
        Overloaded. Appends a string value and its key.
        Parameters:
        key - The key to use
        value - The string value to use
      • appendKeyValue

        public void appendKeyValue​(String key,
                                   char value)
        Overloaded. Appends a char value and its key.
        Parameters:
        key - The key to use
        value - The char value to use
      • appendKeyValue

        public void appendKeyValue​(String key,
                                   boolean value)
        Overloaded method that appends a boolean value and its associated key.
        Parameters:
        key - The key to use
        value - The boolean value to use
      • appendKeyValue

        public void appendKeyValue​(String key,
                                   byte value)
        Overloaded function. Appends a byte value and its key.
        Parameters:
        key - The key to use
        value - The byte value to use
      • appendKeyValue

        public void appendKeyValue​(String key,
                                   short value)
        Overloaded. Appends a short value and its key.
        Parameters:
        key - The key to use
        value - The short value to use
      • appendKeyValue

        public void appendKeyValue​(String key,
                                   int value)
        Overloaded. Appends an int value and its key.
        Parameters:
        key - The key to use
        value - The int value to use
      • appendKeyValue

        public void appendKeyValue​(String key,
                                   long value)
        Overloaded. Appends a long value and its key.
        Parameters:
        key - The key to use
        value - The long value to use
      • appendKeyValue

        public void appendKeyValue​(String key,
                                   float value)
        Overloaded. Appends a float value and its key.
        Parameters:
        key - The key to use
        value - The float value to use
      • appendKeyValue

        public void appendKeyValue​(String key,
                                   double value)
        Overloaded. Appends a double value and its key.
        Parameters:
        key - The key to use
        value - The double value to use
      • appendKeyValue

        public void appendKeyValue​(String key,
                                   Object value)
        Overloaded. Appends an object value and its key.
        Parameters:
        key - The key to use
        value - The object value to use
      • escapeItem

        public String escapeItem​(String item)
        Escapes a key or a value.

        This method ensures that the escaped key or value does not contain any newline characters, such as the carriage return or linefeed characters. Furthermore, it escapes the '\' and '=' characters.

        Parameters:
        item - The key or value to escape
        Returns:
        The escaped key or value