TypeDescriptor<T> class

Class covering the meta-data of a type. T the reflected type

Constructors

TypeDescriptor.new({required String location, required Constructor<T>? constructor, FromMapConstructor<T>? fromMapConstructor, FromArrayConstructor<T>? fromArrayConstructor, required List<ParameterDescriptor> constructorParameters, required List<FieldDescriptor> fields, List<MethodDescriptor>? methods, required List<Object> annotations, bool isAbstract = false, TypeDescriptor? superClass, List<T>? enumValues})

Properties

annotations List<Object>
getter/setter pair
childClasses List<TypeDescriptor>
getter/setter pair
col int
no setter
constructor Constructor<T>?
getter/setter pair
constructorParameters List<ParameterDescriptor>
getter/setter pair
enumValues List<T>?
getter/setter pair
file String
no setter
fromArrayConstructor FromArrayConstructor<T>?
getter/setter pair
fromMapConstructor FromMapConstructor<T>?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isAbstract bool
getter/setter pair
line int
no setter
location String
getter/setter pair
module String
no setter
name String
no setter
objectType ObjectType<T>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
superClass TypeDescriptor?
getter/setter pair
type Type
getter/setter pair

Methods

findAnnotation<A>() → A?
get<V>(Object instance, String field) → V
get the field value of a specific instance instance the instance field the field name
getAnnotation<A>() → A?
getField(String name) FieldDescriptor
return a named field. name the field name
getFieldNames() List<String>
return the field names
getFields() Iterable<FieldDescriptor>
return all fields
getMethods() Iterable<MethodDescriptor>
return all fields
getter(String field) Getter
return the getter function of a specific field
hasDefaultConstructor() bool
hasField(String name) bool
return true, if the type has a named field name the field name
hasInheritedClasses() bool
isEnum() bool
isImmutable() bool
return true, if the type has at least one final field
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(Object instance, String field, dynamic value) → void
set a field value instance the instance field the field name value a value
setter(String field) Setter
return the setter function of a specific field
setup(List<FieldDescriptor> fields, List<MethodDescriptor>? methods) → void
toString() String
A string representation of this object.
inherited
validate(T instance) → void

Operators

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

Static Methods

deepEquals(Object a, Object? b) bool
forName(String type) TypeDescriptor
forType<T>([Type? type]) TypeDescriptor
Return a new or cached 'TypeDescriptor' given a type. T the reflected type
hasType(Type type) bool
register<T>(TypeDescriptor<T> typeDescriptor) → void
types() Iterable<TypeDescriptor>
verify() → void