A JSON string. asInt, asDouble and asBoolean convert numeric and
"true" / "false" text.
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.
override
-
toJson()
→ String
-
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.
inherited
-
values()
→ Iterable<JsonNode>
-
The elements of an array or the property values of an object; empty
for other nodes.
inherited