com.fasterxml.jackson.core

Class JsonPointer



  • public class JsonPointer
    extends Object
    Implementation of JSON Pointer specification. Pointer instances can be used to locate logical JSON nodes for things like tree traversal (see TreeNode.at(com.fasterxml.jackson.core.JsonPointer)). It may be used in future for filtering of streaming JSON content as well (not implemented yet for 2.3).

    Instances are fully immutable and can be shared, cached.

    Since:
    2.3
    Author:
    Tatu Saloranta
    • Property Detail

      • mayMatch

    • Field Detail

      • EMPTY

        protected static final JsonPointer EMPTY
        Marker instance used to represent segment that matches current node or position.
      • _nextSegment

        protected final JsonPointer _nextSegment
        Reference to rest of the pointer beyond currently matching segment (if any); null if this pointer refers to a matching segment.
      • _asString

        protected final String _asString
        We will retain representation of the pointer, as a String, so that toString() should be as efficient as possible.
      • _matchingPropertyName

        protected final String _matchingPropertyName
      • _matchingElementIndex

        protected final int _matchingElementIndex
    • Constructor Detail

      • JsonPointer

        protected JsonPointer()
        Constructor used for creating "empty" instance, used to represent state that matches current node.
      • JsonPointer

        protected JsonPointer(String fullString,
                   String segment,
                   JsonPointer next)
        Constructor used for creating non-empty Segments
    • Method Detail

      • matches

        public boolean matches()
      • getMatchingProperty

        public String getMatchingProperty()
      • getMatchingIndex

        public int getMatchingIndex()
      • mayMatchProperty

        public boolean mayMatchProperty()
      • mayMatchElement

        public boolean mayMatchElement()
      • matchElement

        public JsonPointer matchElement(int index)
      • tail

        public JsonPointer tail()
        Accessor for getting a "sub-pointer", instance where current segment has been removed and pointer includes rest of segments;
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • _parseQuotedTail

        protected static JsonPointer _parseQuotedTail(String input,
                                   int i)
        Method called to parse tail of pointer path, when a potentially escaped character has been seen.
        Parameters:
        input - Full input for the tail being parsed
        i - Offset to character after tilde

Copyright © 2014-2015 FasterXML. All Rights Reserved.