Class JsonPointerTracker


  • public class JsonPointerTracker
    extends java.lang.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 Detail

      • currentNode

        private final java.lang.String currentNode
      • jsonPointer

        private java.lang.String jsonPointer
    • Constructor Detail

      • JsonPointerTracker

        public JsonPointerTracker​(JsonPointerTracker parent,
                                  java.lang.String currentNode)
        Parameters:
        parent - or null if this is the root object
        currentNode - 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 node
        i - current counter number
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • encode

        private static java.lang.String encode​(java.lang.String s)
      • replace

        private static java.lang.String replace​(java.lang.String src,
                                                java.lang.String from,
                                                java.lang.String to)