@Target(value=TYPE)
@Retention(value=CLASS)
public @interface Mixin
value() where possible
using class literals. However for anonymous inner classes,
package-private classes, or unavailable classes (eg. synthetic classes)
being targetted via @Pseudo, the targets should be
specified via the targets() instead.priority() is used to express the mixin's desired
ordering with respect to other mixins being applied to the same target
class.| Modifier and Type | Optional Element and Description |
|---|---|
int |
priority
Priority for the mixin, relative to other mixins targetting the same
classes.
|
boolean |
remap
By default, the annotation processor will attempt to locate an
obfuscation mapping for all
Overwrite, Shadow and
Inject annotated members
since it is anticipated that in general the target of a Mixin
will be an obfuscated class and all annotated members will need to be
added to the obfuscation table. |
java.lang.String[] |
targets
|
java.lang.Class<?>[] |
value
Target class(es) for this mixin
|
public abstract java.lang.Class<?>[] value
public abstract java.lang.String[] targets
value() requires that the classes be
publicly visible, this property is provided to allow package-private,
anonymous innner, and private inner, or unavailable (@Pseudo classes to be referenced. Referencing an otherwise public
class using this property is an error condition and will raise a warning
at runtime or an error if strict checks are enabled. It is completely fine to specify both publi
and private targets for the same mixin however.
Note that unlike class literals specified in value(), imports
are not supported and therefore the class specified here must be
fully-qualified with the package name.
pseudo classes this
mixin targetspublic abstract int priority
Priorities sort mixins into natural order with lower priority mixins being applied first. This changes the nature of priority based on your intentions. Especially with respect to injectors, which must be considered on a case-by-case basis since the semantics of priority vary by injector because of first-come-first-served versus implied ordering of injectors such as inject-at-HEAD.
public abstract boolean remap
Overwrite, Shadow and
Inject annotated members
since it is anticipated that in general the target of a Mixin
will be an obfuscated class and all annotated members will need to be
added to the obfuscation table. However since it is possible to also
apply mixins to non-obfuscated targets it may be desirable to suppress
the compiler warnings which would otherwise be generated. This can be
done on an individual member basis by setting remap to
false on the individual annotations, or disabled for the entire
mixin by setting the value here to false. Doing so will cause
the annotation processor to skip all annotations in this mixin when
building the obfuscation table unless the individual annotation is
explicitly decorated with remap = true.