public class ValueListViewerContext extends ListViewerContext
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.
| Modifier | Constructor and Description |
|---|---|
|
ValueListViewerContext()
Overloaded.
|
protected |
ValueListViewerContext(ViewerId vi)
Overloaded.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendKeyValue(String key,
boolean value)
Overloaded method that appends a boolean value and its associated key.
|
void |
appendKeyValue(String key,
byte value)
Overloaded function.
|
void |
appendKeyValue(String key,
char value)
Overloaded.
|
void |
appendKeyValue(String key,
double value)
Overloaded.
|
void |
appendKeyValue(String key,
float value)
Overloaded.
|
void |
appendKeyValue(String key,
int value)
Overloaded.
|
void |
appendKeyValue(String key,
long value)
Overloaded.
|
void |
appendKeyValue(String key,
Object value)
Overloaded.
|
void |
appendKeyValue(String key,
short value)
Overloaded.
|
void |
appendKeyValue(String key,
String value)
Overloaded.
|
String |
escapeItem(String item)
Escapes a key or a value.
|
escapeLine, escapeLineappendLine, appendText, close, getViewerData, loadFromFile, loadFromReader, loadFromStream, loadFromText, resetDatagetViewerIdpublic ValueListViewerContext()
protected ValueListViewerContext(ViewerId vi)
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.
vi - The viewer ID to usepublic void appendKeyValue(String key, String value)
key - The key to usevalue - The string value to usepublic void appendKeyValue(String key, char value)
key - The key to usevalue - The char value to usepublic void appendKeyValue(String key, boolean value)
key - The key to usevalue - The boolean value to usepublic void appendKeyValue(String key, byte value)
key - The key to usevalue - The byte value to usepublic void appendKeyValue(String key, short value)
key - The key to usevalue - The short value to usepublic void appendKeyValue(String key, int value)
key - The key to usevalue - The int value to usepublic void appendKeyValue(String key, long value)
key - The key to usevalue - The long value to usepublic void appendKeyValue(String key, float value)
key - The key to usevalue - The float value to usepublic void appendKeyValue(String key, double value)
key - The key to usevalue - The double value to usepublic void appendKeyValue(String key, Object value)
key - The key to usevalue - The object value to usepublic String escapeItem(String item)
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.
item - The key or value to escapeCopyright © 2023. All rights reserved.