@Target(value={METHOD,FIELD})
@Retention(value=CLASS)
public @interface Dynamic
Its use on mixin elements is encouraged because it yields the following benefits:
Because of the possible inclusion in error messages, it is suggested that the description provided via @Dynamic provides as much information in as terse a manner possible. Good examples of text descriptions to include might be:
In other words, the contents of the @Dynamic should try to provide as much useful context for the decorated method without being overly verbose.
In the case where the target method or field is added by an upstream
mixin, and the mixin in question is on the classpath of the project, it is
also possible to use the mixin() value to specify the mixin which
contributes the target member. This provides both a useful navigable link in
IDEs, and useful context for mixin tooling such as IDE plugins.
If the target member is contributed by an upstream mixin but the mixin is
not on the classpath of the current project, using the fully-
qualified name of the upstream mixin as the value() is a useful
fallback, since developers reading the source code can still use the string
value as a search term in their IDE or on Github.
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.Class<?> |
mixin
If the target member is added by an upstream mixin, and the mixin in
question is on the classpath, specify the mixin class here in order to
provide useful context for the annotated member.
|
java.lang.String |
value
Description of this @Dynamic member.
|
public abstract java.lang.String value
mixin() is specified instead.