ConstructorReflection<O> class

Inheritance

Constructors

ConstructorReflection(ClassReflection<O> classReflection, Type declaringType, String name, ConstructorReflectionAccessor constructorAccessor, List<ParameterReflection>? normalParameters, List<ParameterReflection>? optionalParameters, Map<String, ParameterReflection>? namedParameters, List<Object>? annotations, {Type? type, ConstructorInvoker<O>? invoker})

Properties

allJsonParametersNames → List<String>
Returns allParameters names.
no setterinherited
allParameters → List<ParameterReflection>
Returns all the parameters: normalParameters, optionalParameters, namedParameters.
no setterinherited
allParametersNames → List<String>
Returns allParameters names.
no setterinherited
annotations ↔ List<Object>
The method annotations.
getter/setter pairinherited
canInvokeFromResolvedMap → bool
Whether _resolvedMapArguments can build the invoker arguments: constructors with optional positional parameters, or of classes with JSON name aliases, take the MethodInvocation path.
no setter
className → String
Returns the class name of this element.
no setterinherited
classReflection → ClassReflection<O>
The ClassReflection of this element.
finalinherited
constructor → Function
no setter
constructorAccessor → ConstructorReflectionAccessor
final
declaringType → Type
The Type that declared this element.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
hasJsonConstructor → bool
Returns true if this constructor has a JsonConstructor annotation.
no setter
hasJsonConstructorMandatory → bool
Returns true if this constructor has a JsonConstructor.mandatory annotation.
no setter
hasJsonNameAlias → bool
Returns true if any field or constructor parameter uses a JsonFieldAlias.
no setterinherited
hasNoParameters → bool
Returns true if this methods has no arguments/parameters.
no setterinherited
invoker → ConstructorInvoker<O>?
Calls the constructor directly, without Function.apply.
final
isDefaultConstructor → bool
no setter
isNamed → bool
no setter
isStatic → bool
Returns true if this element is static.
no setterinherited
jsonAnnotations → List<JsonAnnotation>
Returns the JsonAnnotation of this constructor.
no setter
jsonConstructorAnnotations → List<JsonConstructor>
Returns the JsonConstructor of this field.
no setter
name → String
The name of this method.
finalinherited
namedParameters → Map<String, ParameterReflection>
The named parameters Types of this method.
finalinherited
namedParametersNames → List<String>
Returns the namedParameters names.
no setterinherited
namedParametersTypeReflection → Map<String, TypeReflection>
Returns the namedParameters TypeReflections.
no setterinherited
namedParametersTypes → Map<String, Type>
Returns the namedParameters Types.
no setterinherited
normalParameters → List<ParameterReflection>
The normal parameters Types of this method.
finalinherited
normalParametersNames → List<String>
Returns the normalParameters names.
no setterinherited
normalParametersTypeReflection → List<TypeReflection>
Returns the normalParameters TypeReflections.
no setterinherited
normalParametersTypes → List<Type>
Returns the normalParameters Types.
no setterinherited
optionalParameters → List<ParameterReflection>
The optional parameters Types of this method.
finalinherited
optionalParametersNames → List<String>
Returns the optionalParameters names.
no setterinherited
optionalParametersTypeReflection → List<TypeReflection>
Returns the optionalParameters TypeReflections.
no setterinherited
optionalParametersTypes → List<Type>
Returns the optionalParameters Types.
no setterinherited
parametersLength → int
Returns the amount of parameters.
no setterinherited
positionalParametersLength → int
Returns the amount of positional parameters (normalParameters + optionalParameters).
no setterinherited
positionalParametersNames → List<String>
The names of the positional parameters (normalParameters + optionalParameters).
no setterinherited
requiredParametersLength → int
Returns the amount of required parameters.
no setterinherited
returnNullable → bool
true if the returned value of this method can be null.
finalinherited
returnType → TypeReflection?
The return Type of this method. Returns null for void type.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

compareTo(FunctionReflection other) → int
Compares this object to another object.
inherited
equalsNamedParametersTypes(Map<String, Type> parameters, {bool equivalency = false}) → bool
Returns true if parameters is equals to namedParameters.
inherited
equalsNormalParametersTypes(List<Type> parameters, {bool equivalency = false}) → bool
Returns true if parameters is equals to normalParameters.
inherited
equalsOptionalParametersTypes(List<Type> parameters, {bool equivalency = false}) → bool
Returns true if parameters is equals to optionalParameters.
inherited
getParameterByIndex(int index) → ParameterReflection?
Returns a ParameterReflection by index.
inherited
getParameterByName(String name, {bool jsonName = false}) → ParameterReflection?
Returns a ParameterReflection by name.
inherited
getParametersByNames(Iterable<String> names, {bool jsonName = false}) → List<ParameterReflection>
Returns allParameters in names list.
inherited
invoke(Iterable<Object?>? positionalArguments, [Map<Symbol, Object?>? namedArguments]) → O
Invoke this method.
inherited
invokeWith(MethodInvocation methodInvocation) → O
Invokes this constructor with the parameters of methodInvocation.
methodInvocation(ParameterProvider parameterProvider) → MethodInvocation<O>
Creates a MethodInvocation using parameterProvider.
inherited
methodInvocationFromMap(Map<String, dynamic> map, {FieldValueResolver? reviver, FieldNameResolver? nameResolver, bool jsonName = false}) → MethodInvocation<O>
Creates a MethodInvocation using map entries as parameters.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parametersNamesWhere(bool test(ParameterReflection parameter), {bool jsonName = false, String nameResolver(ParameterReflection parameter, String name)?}) → Iterable<String>
Returns a List of parameters names that matches test.
inherited
parametersWhere(bool test(ParameterReflection parameter)) → Iterable<ParameterReflection>
Returns a List of ParameterReflection that matches test.
inherited
resolveAllParametersNames(bool jsonName) → List<String>
inherited
toString() → String
A string representation of this object.
override

Operators

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

Static Methods

argOrDefault<T>(Object? arg, T defaultValue) → T
The invoker value of an omittable parameter: defaultValue when arg is absentArgument, otherwise arg cast to T.

Constants

absentArgument → const Object
The invoker argument of an omitted optional or named parameter: the generated invoker passes the parameter's default value instead, written in its code, so it has the parameter's type (e.g. 0.0 for double x = 0, not the int of ParameterReflection.defaultValue).