JsonPointer class abstract
A JSON Pointer RFC 6901.
- Implementers
Constructors
- JsonPointer([String expression = ''])
-
Creates a new JSON Pointer from a string
expression
. Throws a FormatException if the expression has invalid format. Example:factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- parent → JsonPointer?
-
The parent pointer. In the empty pointer this property is
null
.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
Object? document, Object? newValue) → Object? -
Returns a copy of
document
with thenewValue
added at the referenced location. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
Object? document, {Object? orElse()?}) → Object? -
Reads the referenced value from the
document
. If no value is referenced, gets the value fromorElse
or throws BadRoute. -
remove(
Object? document) → Object? -
Returns a copy of
document
with the value at the referenced location removed. This method returns null if the entire document is referenced (i.e. JSON Path expression is an empty string). -
toJson(
) → String - Returns the string representation of the pointer.
-
toString(
) → String -
Returns the string representation of the pointer.
override
-
write(
Object? document, Object? newValue) → Object? -
Returns a copy of
document
with the referenced value set tonewValue
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
build(
Iterable< String> tokens) → JsonPointer -
Creates a new JSON Pointer from reference
tokens
.