Object JSONPointer.Companion
-
- All Implemented Interfaces:
public class JSONPointer.Companion
-
-
Field Summary
Fields Modifier and Type Field Description private final JSONPointerrootpublic final static JSONPointer.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final JSONPointerfrom(Array<String> array)Create a JSONPointerfrom an array of tokens.final JSONPointerfrom(List<String> list)Create a JSONPointerfrom a list of tokens.final JSONValuefind(String pointer, JSONValue base)Find the JSONValue that this pointer string points to within the specified base value, or throw an exception if the pointer string does not reference a valid location in the base value. final JSONValuefind(Array<String> tokens, JSONValue base)Find the JSONValue that this set of tokens points to within the specified base value, or throw an exception if the tokens do not reference a valid location in the base value. final JSONValuefindOrNull(String pointer, JSONValue base)Find the JSONValue that this pointer string points to within the specified base value, or nullif the pointer string does not reference a valid location in the base value.final JSONValuefindOrNull(Array<String> tokens, JSONValue base)Find the JSONValue that this set of tokens points to within the specified base value, or nullif the tokens do not reference a valid location in the base value.final BooleanexistsIn(String string, JSONValue base)Test whether this pointer string references a valid location in specified base value. final BooleanexistsIn(Array<String> tokens, JSONValue base)Test whether this set of tokens references a valid location in specified base value. final StringtoString(Array<String> tokens, Integer n)Create the string form of a JSON pointer from the first n tokens in the specified array. final Array<String>parseString(String string)Parse a JSON Pointer string into an array of string tokens. final JSONPointerfromURIFragment(String fragment)Create a JSONPointerfrom a URI fragment.final StringencodeJSONPointer(String $self)Encode a string using the character substitutions specified for JSON pointer token. final StringdecodeJSONPointer(String $self)Decode a string encoded using the character substitutions specified for JSON pointer token. final JSONPointergetRoot()The root JSONPointer.-
-
Method Detail
-
from
final JSONPointer from(Array<String> array)
Create a
JSONPointerfrom an array of tokens.
-
from
final JSONPointer from(List<String> list)
Create a
JSONPointerfrom a list of tokens.
-
find
final JSONValue find(String pointer, JSONValue base)
Find the JSONValue that this pointer string points to within the specified base value, or throw an exception if the pointer string does not reference a valid location in the base value.
-
find
final JSONValue find(Array<String> tokens, JSONValue base)
Find the JSONValue that this set of tokens points to within the specified base value, or throw an exception if the tokens do not reference a valid location in the base value.
-
findOrNull
final JSONValue findOrNull(String pointer, JSONValue base)
Find the JSONValue that this pointer string points to within the specified base value, or
nullif the pointer string does not reference a valid location in the base value.
-
findOrNull
final JSONValue findOrNull(Array<String> tokens, JSONValue base)
Find the JSONValue that this set of tokens points to within the specified base value, or
nullif the tokens do not reference a valid location in the base value.
-
existsIn
final Boolean existsIn(String string, JSONValue base)
Test whether this pointer string references a valid location in specified base value.
-
existsIn
final Boolean existsIn(Array<String> tokens, JSONValue base)
Test whether this set of tokens references a valid location in specified base value.
-
toString
final String toString(Array<String> tokens, Integer n)
Create the string form of a JSON pointer from the first n tokens in the specified array.
-
parseString
final Array<String> parseString(String string)
Parse a JSON Pointer string into an array of string tokens.
-
fromURIFragment
final JSONPointer fromURIFragment(String fragment)
Create a
JSONPointerfrom a URI fragment.
-
encodeJSONPointer
final String encodeJSONPointer(String $self)
Encode a string using the character substitutions specified for JSON pointer token.
-
decodeJSONPointer
final String decodeJSONPointer(String $self)
Decode a string encoded using the character substitutions specified for JSON pointer token.
-
getRoot
final JSONPointer getRoot()
The root
JSONPointer.
-
-
-
-