Class AbstractJsonPointer
java.lang.Object
com.flipkart.zjsonpatch.AbstractJsonPointer
- Direct Known Subclasses:
Jackson3JsonPointer,JsonPointer
public abstract sealed class AbstractJsonPointer
extends Object
permits JsonPointer, Jackson3JsonPointer
- Since:
- 0.6.0
- Author:
- Mariusz Sondecki
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractJsonPointer(RefToken[] tokens) protectedAbstractJsonPointer(List<RefToken> tokens) Constructs a new pointer from a list of reference tokens. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AbstractJsonPointercreateInstance(RefToken[] tokens) Decomposes this JSON pointer into its reference tokens.booleanget(int index) Retrieves the reference token at the specified index.protected RefToken[]inthashCode()booleanisRoot()Indicates whether or not this instance points to the root of a JSON document.last()Retrieves the last reference token for this JSON pointer.parseTokens(String path) toString()Returns a string representation of this instance
-
Constructor Details
-
AbstractJsonPointer
-
AbstractJsonPointer
-
-
Method Details
-
createInstance
-
isRoot
public boolean isRoot()Indicates whether or not this instance points to the root of a JSON document.- Returns:
trueif this pointer represents the root node,falseotherwise.
-
getTokens
-
parseTokens
- Throws:
IllegalArgumentException
-
toString
Returns a string representation of this instance- Overrides:
toStringin classObject- Returns:
- An RFC 6901 compliant string representation of this JSON pointer.
-
decompose
-
get
Retrieves the reference token at the specified index.- Parameters:
index- The desired reference token index.- Returns:
- The specified instance of
RefToken. - Throws:
IndexOutOfBoundsException- The specified index is illegal.
-
last
Retrieves the last reference token for this JSON pointer.- Returns:
- The last
RefTokencomprising this instance. - Throws:
IllegalStateException- Last cannot be called on root pointers.
-
equals
-
hashCode
-