JsonTextNode class

Represents a JSON string node in the Dart JSON model.

This node wraps a String value and provides type-checking consistent with JsonNode.

Usage Example

final textNode = JsonTextNode('Hello, world!');

if (textNode.isTextual()) {
  print(textNode.toObject()); // 'Hello, world!'
}

Behavior Overview

Dart JSON Value Internal Representation Description
"text" value = 'text' Simple JSON string
"" value = '' Empty string

Design Notes

  • Stores the string in a final value field for immutability.
  • Supports safe conversion back to native Dart String via toObject.
  • Type-checking methods are consistent with the JsonNode interface.
Implemented types

Constructors

JsonTextNode(String value)
Creates a new JsonTextNode wrapping the given value.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value String
The underlying string value of this JSON node.
final

Methods

isArray() bool
Returns true if this node represents a JSON array ([...]).
override
isBoolean() bool
Returns true if this node represents a JSON boolean (true or false).
override
isNull() bool
Returns true if this node represents a JSON null.
override
isNumber() bool
Returns true if this node represents a JSON number.
override
isObject() bool
Returns true if this node represents a JSON object ({...}).
override
isTextual() bool
Returns true if this node represents a JSON string.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toObject() String
Generic interface representing a parsed node in JetLeaf's structured data model (JSON/YAML/other).
override
toString() String
A string representation of this object.
inherited

Operators

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