BeanParameter class final

The description of one parameter of a constructor or method: its name, full type, whether it is named or required, and its annotations.

ObjectMapper reads those of a BeanConstructor to know which JSON fields to pass; request binding reads those of a BeanMethod to know what to bind (@PathVariable(), @RequestParam()). Written by the generator.

// Book({required this.isbn, this.tags = const []})
const isbn = BeanParameter('isbn', type: ClassType<String>(),
    symbol: #isbn, isRequired: true);
const tags = BeanParameter('tags',
    type: ListType<String>(ClassType<String>()), symbol: #tags,
    hasDefaultValue: true, defaultValue: <String>[]);

Spring (Java): java.lang.reflect.Parameter (with -parameters).

Constructors

BeanParameter(String name, {required TypeInfo<Object?> type, Symbol? symbol, bool isRequired = false, bool hasDefaultValue = false, Object? defaultValue, List<Object> annotations = const []})
Describes the parameter name of type. A named parameter carries its symbol (a const symbol literal, safe in minified builds).
const

Properties

annotations → List<Object>
The const annotations on the parameter.
final
defaultValue → Object?
The default value when hasDefaultValue is true (null for an explicit = null, and when there is none).
final
hasDefaultValue → bool
Whether the parameter declares a default value that the generator could write into the description, so defaultValue is meaningful.
final
hashCode → int
The hash code for this object.
no setterinherited
isNamed → bool
Whether the parameter is named.
no setter
isRequired → bool
Whether a value must be passed (positional without default, or required).
final
name → String
The parameter's name.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
symbol → Symbol?
#name for a named parameter; null for a positional one.
final
type → TypeInfo<Object?>
The full declared type.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

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