Class JsonPointerTracker
- java.lang.Object
-
- org.apache.johnzon.mapper.internal.JsonPointerTracker
-
public class JsonPointerTracker extends Object
Internal class to easily collect information about the 'depth' of a json object without having to eagerly construct it.For use in recursive generator and parser method calls to defer string operations.
-
-
Field Summary
Fields Modifier and Type Field Description private String
currentNode
private String
jsonPointer
private JsonPointerTracker
parent
static JsonPointerTracker
ROOT
-
Constructor Summary
Constructors Constructor Description JsonPointerTracker(JsonPointerTracker jsonPointer, int i)
For Arrays and Lists.JsonPointerTracker(JsonPointerTracker parent, String currentNode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static String
encode(String s)
private static String
replace(String src, String from, String to)
String
toString()
-
-
-
Field Detail
-
ROOT
public static final JsonPointerTracker ROOT
-
parent
private final JsonPointerTracker parent
-
currentNode
private final String currentNode
-
jsonPointer
private String jsonPointer
-
-
Constructor Detail
-
JsonPointerTracker
public JsonPointerTracker(JsonPointerTracker parent, String currentNode)
- Parameters:
parent
- ornull
if this is the root objectcurrentNode
- the name of the attribute or "/" for the root object
-
JsonPointerTracker
public JsonPointerTracker(JsonPointerTracker jsonPointer, int i)
For Arrays and Lists.- Parameters:
jsonPointer
- the json nodei
- current counter number
-
-