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 StringcurrentNodeprivate StringjsonPointerprivate JsonPointerTrackerparentstatic JsonPointerTrackerROOT
-
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 Stringencode(String s)private static Stringreplace(String src, String from, String to)StringtoString()
-
-
-
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- ornullif 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
-
-