DecoratorAST class
Represents a parsed decorator annotation found on a class, method, or field declaration.
DecoratorAST extracts the decorator name, all named/positional arguments,
and supports fromYaml references for complex configuration.
- Annotations
Constructors
-
DecoratorAST({required String name, required AstNode target, String? constructorName, List positionalArgs = const [], Map<
String, dynamic> namedArgs = const {}, Map<String, dynamic> ? yamlReference, SourceLocation? sourceLocation}) -
const
Properties
- constructorName → String?
-
The named constructor being invoked, e.g.
redirectfor@Route.redirect(from: ..., to: ...). Null when the annotation uses the default constructor (@Route(...)).final - hashCode → int
-
The hash code for this object.
no setterinherited
- hasYamlReference → bool
-
Whether this decorator has a
fromYamlreference.no setter - name → String
-
The decorator name without the
@prefix, e.g.Cacheable,XRayMock.final -
namedArgs
→ Map<
String, dynamic> -
Named arguments passed to the decorator constructor.
final
- positionalArgs → List
-
Positional arguments passed to the decorator constructor.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sourceLocation → SourceLocation?
-
Source location for error reporting.
final
- target → AstNode
-
The AST node this decorator is attached to.
final
-
yamlReference
→ Map<
String, dynamic> ? -
If the decorator uses
@Decorator.fromYaml('path.yaml'), this holds the resolved YAML content as a Map. Null otherwise.final
Methods
-
get<
T> (String key, {T? defaultValue}) → T? -
Get a named argument by key, or
defaultValueif absent. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
require<
T> (String key) → T - Get a required named argument. Throws if absent.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited