Token class

A Token represents a single token in the json file. It holds the value, the type, the path and the name of the token and it also holds the name of the variable that will be generated for this token.

A token can hold a reference to another token directly or indirectly when one of the values in the values Map is a reference.

Constructors

Token({required dynamic value, required String? type, required String path, required String name, Map<String, dynamic>? extensions, String? variableName})
Create a new Token instance

Properties

extensions Map<String, dynamic>?
The extensions of the token
final
hasExtensions bool
no setter
hashCode int
The hash code for this object.
no setterinherited
name String
The name of the token
final
path String
The path where this token was found in the json file
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String?
final
value → dynamic
The value this token holds
final
valueAsString String?
The value of the token as a string
no setter
valueByRef String
The name of the token that is referenced without the leading '$' or '{' and '}' characters
no setter
variableName String
The name of the variable that will be generated for this token Based on the path and name of the token
final

Methods

copyWith({String? path, String? variableName, String? type, dynamic value, Map<String, dynamic>? extensions}) Token
Returns a copy of this token with the given values. If the path is set, the variable name will be updated as well.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveAllReferences(Map<String, Token> tokenMap) Token
toString() String
A string representation of this object.
override

Operators

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