Package com.gurock.smartinspect.contexts
Class InspectorViewerContext
- java.lang.Object
-
- com.gurock.smartinspect.contexts.ViewerContext
-
- com.gurock.smartinspect.contexts.TextContext
-
- com.gurock.smartinspect.contexts.ListViewerContext
-
- com.gurock.smartinspect.contexts.ValueListViewerContext
-
- com.gurock.smartinspect.contexts.InspectorViewerContext
-
public class InspectorViewerContext extends ValueListViewerContext
Represents the inspector viewer in the Console which displays key/value pairs in an object inspector control.The inspector viewer in the Console interprets the data of a Log Entry as a key/value list with group support like object inspectors from popular IDEs. This class takes care of the necessary formatting and escaping required by the corresponding inspector viewer in the Console.
You can use the InspectorViewerContext class for creating custom log methods around logCustomContext for sending custom data organized as grouped key/value pairs.
Thread Safety: This class is not guaranteed to be thread safe.
-
-
Constructor Summary
Constructors Constructor Description InspectorViewerContext()Creates and initializes an InspectorViewerContext instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringescapeItem(String item)Overridden.voidstartGroup(String group)Starts a new group.-
Methods inherited from class com.gurock.smartinspect.contexts.ValueListViewerContext
appendKeyValue, appendKeyValue, appendKeyValue, appendKeyValue, appendKeyValue, appendKeyValue, appendKeyValue, appendKeyValue, appendKeyValue, appendKeyValue
-
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
-
-
-
-
Method Detail
-
startGroup
public void startGroup(String group)
Starts a new group.- Parameters:
group- The name of the group to use.
-
escapeItem
public String escapeItem(String item)
Overridden. 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.- Overrides:
escapeItemin classValueListViewerContext- Parameters:
item- The key or value to escape.- Returns:
- The escaped key or value.
-
-