Role class
Declares the design role of a class or method within a Jetleaf application.
This annotation is intended for design-time metadata and architectural documentation. It can also be used by tooling (e.g., code generators, analyzers) to enforce architectural rules.
Example
@Role(DesignRole.APPLICATION)
class UserService {
Future<User> findById(String id) {
// business logic here
}
}
@Role(DesignRole.APPLICATION)
class UserController {
final UserService service;
UserController(this.service);
@Get('/users/:id')
Future<User> getUser(String id) => service.findById(id);
}
Note:
@Role
is not required for Jetleaf runtime behavior, but it is highly recommended for clarity and tooling support.
- Annotations
-
- @Target.new({TargetKind.classType, TargetKind.method})
Constructors
- Role(DesignRole value)
-
Declares the design role of a class or method within a Jetleaf
application.
const
Properties
- annotationType → Type
-
Returns the annotation _type of this annotation.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → DesignRole
-
Defines the architectural role of a component within a system.
final
Methods
-
equalizedProperties(
) → List< Object?> -
Mixin-style contract for value-based equality,
hashCode
, andtoString
. -
equals(
Object other) → bool -
Checks whether the given object is logically equivalent to this annotation.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String - Returns a string representation of this annotation.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited