Class ValueListViewerContext
- java.lang.Object
-
- com.gurock.smartinspect.contexts.ViewerContext
-
- com.gurock.smartinspect.contexts.TextContext
-
- com.gurock.smartinspect.contexts.ListViewerContext
-
- com.gurock.smartinspect.contexts.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 Entryas 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
logCustomContextfor sending custom data organized as key/value lists.This class is not guaranteed to be thread safe.
-
-
Constructor Summary
Constructors Modifier Constructor Description ValueListViewerContext()Overloaded.protectedValueListViewerContext(ViewerId vi)Overloaded.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendKeyValue(String key, boolean value)Overloaded method that appends a boolean value and its associated key.voidappendKeyValue(String key, byte value)Overloaded function.voidappendKeyValue(String key, char value)Overloaded.voidappendKeyValue(String key, double value)Overloaded.voidappendKeyValue(String key, float value)Overloaded.voidappendKeyValue(String key, int value)Overloaded.voidappendKeyValue(String key, long value)Overloaded.voidappendKeyValue(String key, short value)Overloaded.voidappendKeyValue(String key, Object value)Overloaded.voidappendKeyValue(String key, String value)Overloaded.StringescapeItem(String item)Escapes a key or a value.-
Methods inherited from class com.gurock.smartinspect.contexts.ListViewerContext
escapeLine, escapeLine
-
Methods inherited from class com.gurock.smartinspect.contexts.TextContext
appendLine, appendText, close, getViewerData, loadFromFile, loadFromReader, loadFromStream, loadFromText, resetData
-
Methods inherited from class com.gurock.smartinspect.contexts.ViewerContext
getViewerId
-
-
-
-
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 usevalue- 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 usevalue- 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 usevalue- 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 usevalue- 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 usevalue- 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 usevalue- 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 usevalue- 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 usevalue- 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 usevalue- 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 usevalue- 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
-
-