FieldReflection<O, T> class

A class field reflection.

Inheritance

Constructors

FieldReflection(ClassReflection<O> classReflection, Type declaringType, TypeReflection type, String name, bool nullable, FieldReflectionGetterAccessor<O, T> getterAccessor, FieldReflectionSetterAccessor<O, T>? setterAccessor, O? object, bool isFinal, [List<Object>? annotations])

Properties

annotations → List<Object>
The field annotations.
no setterinherited
className → String
Returns the class name of this element.
no setterinherited
classReflection → ClassReflection<O>
The ClassReflection of this element.
finalinherited
declaringType → Type
The Type that declared this element.
finalinherited
defaultValue → Object?
The default value of the field.
no setterinherited
getterAccessor → FieldReflectionGetterAccessor<O, T>
A Function that returns the field getter.
final
hasDefaultValue → bool
Returns true if defaultValue is NOT null.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
hasJsonFieldHidden → bool
no setterinherited
hasJsonFieldVisible → bool
no setterinherited
hasJsonNameAlias → bool
Returns true if this field/parameter has a JsonFieldAlias with a valid name.
no setterinherited
hasSetter → bool
no setteroverride
isEntityField → bool
Returns true if this Field can be an entity field. Usually an entity field can be used in a JSON, toJson and fromJson.
no setterinherited
isFinal → bool
Returns true if this field is final.
finalinherited
isJsonFieldHidden → bool
Returns true if this field has a JsonField annotation with JsonField.isHidden.
no setterinherited
isJsonFieldVisible → bool
Returns true if this field has a JsonField annotation with JsonField.isVisible.
no setterinherited
isStatic → bool
Returns true if this element is static.
no setteroverride
jsonAnnotations → List<JsonAnnotation>
Returns the JsonAnnotation of this field.
no setterinherited
jsonFieldAliasAnnotations → List<JsonFieldAlias>
Returns the JsonFieldAlias of this field.
no setterinherited
jsonFieldAnnotations → List<JsonField>
Returns the JsonField of this field.
no setterinherited
jsonName → String
Returns the JsonFieldAlias alias name or the declared name of this field/parameter.
no setterinherited
name → String
Returns name of this field.
finalinherited
nullable → bool
Returns true if this field is nullable.
finalinherited
object → O?
Returns the associated object (O) of this field. Returns null for static fields.
final
required → bool
Returns true if this field is NOT nullable.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
setterAccessor → FieldReflectionSetterAccessor<O, T>?
A Function that returns the field setter.
final
type → TypeReflection
Returns Type of this field.
finalinherited

Methods

get() → T
Returns this field value.
override
getFor(O object) → T
Returns this field value for the object instance.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveName(bool jsonName) → String
Resolves to name or to jsonName.
inherited
set(T v) → void
Sets this field value. See setNullable.
override
setFor(O object, T v) → void
Sets this field value for the object instance. See setNullable.
setNullable(T? v) → void
Sets this field value, allowing a nullable value. Throws an ArgumentError if v can't be null. See set.
override
setNullableFor(O object, T? v) → void
Sets this field value, allowing a nullable value. Throws an ArgumentError if v can't be null. See set.
toString() → String
A string representation of this object.
override
withObject(O object) → FieldReflection<O, T>
Returns a new instance that references object.

Operators

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