ValueDef class

Represents a value definition in a JSON structure for code generation.

Available extensions

Constructors

ValueDef({String? rootClassName, required bool rootClassNameWithPrefixSuffix, String? key, dynamic value, ClassNamePrefixSuffixBuilder? classNamePrefixSuffixBuilder})

Properties

childrenDef ↔ dynamic
Child definitions (List or Map of ValueDef).
getter/setter pair
classCode String

Available on ValueDef, provided by the DartCodeGenerator extension

Generates the Dart class source code for this value definition.
no setter
classNameFull String
The full generated class name including prefix and suffix.
no setter
classNameNoPrefixSuffix String
The generated class name without prefix or suffix.
no setter
classNamePrefix String
The prefix applied to the generated class name.
no setter
classNamePrefixSuffixBuilder ClassNamePrefixSuffixBuilder?
Callback for generating class name prefixes and suffixes.
getter/setter pair
classNameSuffix String
The suffix applied to the generated class name.
no setter
customObjects List<ValueDef>
Returns all nested custom object definitions.
no setter
customObjectString String
Returns the struct string for all custom objects.
no setter
depth int
The nesting depth of this definition.
no setter
hashCode int
The hash code for this object.
no setterinherited
isListRoot bool
Whether the root ancestor is a list type.
no setter
isRoot bool
Whether this is the root definition (has no parent).
no setter
key String?
The JSON key associated with this value.
final
listInnerType ListInner?
Returns the inner type information for list values.
no setter
listType ClassType?
The element type if this value is a list.
getter/setter pair
parent ValueDef?
The parent definition in the JSON tree.
getter/setter pair
parentKey String?
get parent key
no setter
rootClassName String?
The root class name for code generation.
getter/setter pair
rootClassNameWithPrefixSuffix bool
Whether to apply prefix/suffix to the root class name.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
structString String
Returns a debug string representation of this definition's structure.
no setter
type ClassType
The resolved ClassType of this value.
getter/setter pair
value → dynamic
The raw JSON value.
final

Methods

copyWith({ClassType? type, ClassType? listType, dynamic childrenDef}) ValueDef
Creates a copy of this definition with optional overrides.
findCustomObject(ValueDef def) ValueDef?
Finds a matching custom object definition for def.
isStructSame(ValueDef other, {bool debug = false}) bool
Returns true if this definition has the same structure as other.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
summarize() ValueDef
Summarizes this definition by merging types and converting nulls.
toString() String
A string representation of this object.
override

Operators

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