VlJson class
A JSON value: null, a boolean, a number, text, an array or an object.
This is the value model the whole of Vela exchanges — a specification arrives as one, the chart API emits one, and the runtime reads one. It is pure Ranger with no host JSON, so the same tree is built on every target, which is what makes a scene comparison against the reference implementation mean anything.
Two things it carries that a plain JSON model does not: object keys keep the
order they were written in, so a re-serialised specification is stable; and a
number remembers whether it was written as an integer, so 5 does not come
back as 5.0.
Constructors
- VlJson()
Properties
-
arr
↔ List<
VlJson> -
getter/setter pair
- b ↔ bool
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInt ↔ bool
-
getter/setter pair
-
keys
↔ List<
String> -
getter/setter pair
- kind ↔ int
-
getter/setter pair
-
members
↔ Map<
String, VlJson> -
getter/setter pair
- num ↔ double
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- str ↔ String
-
getter/setter pair
Methods
-
asBool(
) → bool -
asDouble(
) → double -
asInt(
) → int -
asString(
) → String -
at(
int index) → VlJson -
boolOr(
String key, bool dflt) → bool -
count(
) → int -
doubleOr(
String key, double dflt) → double -
has(
String key) → bool -
intOr(
String key, int dflt) → int -
isArray(
) → bool -
isBool(
) → bool -
isDefined(
) → bool -
isNull(
) → bool -
isNumber(
) → bool -
isObject(
) → bool -
isString(
) → bool -
looksNumeric(
) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeMember(
String key) → void -
setMember(
String key, VlJson value) → void -
stringOr(
String key, String dflt) → String -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
arrayValue(
) → VlJson - Builds an empty JSON array.
-
boolValue(
bool value) → VlJson - Builds a JSON boolean.
-
digitAt(
double rest, double place) → int -
digitChar(
int d) → String -
domainKey(
VlJson cell) → String -
formatNumber(
double value, int maxDecimals) → String -
formatSignificant(
double value, int digits) → String -
fractionDigits(
double frac, int maxDecimals) → String -
intToText(
int value) → String -
intValue(
int value) → VlJson -
Builds a JSON number that prints without a fraction, so 5 stays
5. -
nullValue(
) → VlJson - Builds the JSON null value.
-
numberToText(
double value, bool wasInt) → String -
numberValue(
double value) → VlJson -
Builds a JSON number that prints with a fraction, so 5 comes back as
5.0. -
objectValue(
) → VlJson - Builds an empty JSON object.
-
stringValue(
String value) → VlJson - Builds a JSON string.
-
withMinusSign(
String text) → String