MissingNode class final

The stand-in that JsonNode.path and JsonNode.at return where the document has no node, so navigation can go on without null checks.

Its as... accessors return their default (0, '', false, or the one given), so root.path('a').path('b').asInt(10) reads a value or falls back. It differs from a NullNode: the property is absent, not null, and it equals only itself.

Inheritance

Properties

hashCode → int
The hash code for this object.
no setterinherited
isArray → bool
Whether this is an ArrayNode.
no setterinherited
isBoolean → bool
Whether this is a BooleanNode.
no setterinherited
isContainer → bool
Whether this is an object or an array.
no setterinherited
isEmpty → bool
Whether the object or array has no children (true for other nodes).
no setterinherited
isIntegralNumber → bool
Whether this is a number without a fraction.
no setterinherited
isMissingNode → bool
Whether this is the MissingNode.
no setteroverride
isNull → bool
Whether this is the NullNode.
no setterinherited
isNumber → bool
Whether this is a NumericNode.
no setterinherited
isObject → bool
Whether this is an ObjectNode.
no setterinherited
isString → bool
Whether this is a StringNode.
no setterinherited
isValueNode → bool
Whether this is a string, number, boolean or null.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → int
The number of properties of an object or elements of an array; 0 for other nodes.
no setterinherited

Methods

asBoolean([bool? defaultValue]) → bool
The value as a bool: a boolean, "true" / "false", a number (not 0), false for null and a missing node; anything else gives defaultValue, or throws a JsonNodeException without one.
override
asDouble([double? defaultValue]) → double
The value as a double, converted like asInt (a string may be any number, "1.5").
override
asInt([int? defaultValue]) → int
The value as an int (Jackson 3): a finite number (truncated), a string of an integer ("42"), a boolean (1 / 0), 0 for null and a missing node. Anything else gives defaultValue, or throws a JsonNodeException without one; null and a missing node give defaultValue when there is one.
override
asString([String? defaultValue]) → String
The value as a string (Jackson 3): the text of a string, number or boolean, '' for null and a missing node. An object or array gives defaultValue, or throws a JsonNodeException without one; null and a missing node give defaultValue when there is one.
override
at(String pointer) → JsonNode
Returns the node at the JSON Pointer pointer (/book/tags/0; ~1 stands for /, ~0 for ~), or a MissingNode when there is none. An empty pointer gives this node; one not starting with / throws an ArgumentError.
inherited
booleanValue() → bool
Returns the value of a BooleanNode; throws a JsonNodeException for other nodes.
inherited
deepCopy() → JsonNode
Returns a copy that shares no objects or arrays with this node, so it can be changed independently.
inherited
doubleValue() → double
Returns the value of a NumericNode as a double; throws a JsonNodeException for other nodes.
inherited
get(Object nameOrIndex) → JsonNode?
The property nameOrIndex of an object, or the element at index nameOrIndex of an array; null when there is none.
inherited
has(Object nameOrIndex) → bool
Whether get finds a node for nameOrIndex.
inherited
intValue() → int
The value of a NumericNode as an int, when it is one exactly; throws a JsonNodeException for a fraction (1.5), NaN, infinity and other nodes.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
numberValue() → num
Returns the value of a NumericNode; throws a JsonNodeException for other nodes.
inherited
path(Object nameOrIndex) → JsonNode
Like get, but a MissingNode instead of null, so paths can be chained: root.path('a').path('b').
inherited
properties() → Iterable<MapEntry<String, JsonNode>>
The properties of an object as name/node entries, in order; empty for other nodes.
inherited
propertyNames() → Iterable<String>
The property names of an object, in order; empty for other nodes.
inherited
stringValue() → String
Returns the text of a StringNode; throws a JsonNodeException for other nodes. Use asString to convert instead.
inherited
toJson() → Object?
Returns this node as plain decoded JSON: null, a bool, number, string, list or map, as jsonEncode takes it (MissingNode gives null).
override
toPrettyString() → String
This node as JSON text indented by two spaces, for people to read.
inherited
toString() → String
This node as compact JSON text.
override
values() → Iterable<JsonNode>
The elements of an array or the property values of an object; empty for other nodes.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

instance → const MissingNode
The one missing node.