@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface Overwrite
Annotation used to indicate a mixin class member which must overwrite a method in the target class.
The default behaviour of mixin classes when merging mixin methods is to replace methods in the target class which already exist, and simply add any other methods to the target class body as new members. This default behaviour allows methods in the target class to be easily overwritten by simply creating a method in the mixin with a signature matching the member to be overwritten.
This is not sufficient for obfuscated methods however, since as mixins
traverse the obfuscation boundary, this association with the target method is
lost because the method name will change. The Overwrite annotation is
used to indicate to the annotation processor that this method is intended to
overwrite a member in the target class, and should be added to the
obfuscation table if remap() is true.
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.String[] |
aliases
Supplies possible aliases for this method.
|
java.lang.String |
constraints
Returns constraints which must be validated for this overwrite to
succeed.
|
boolean |
remap
|
public abstract java.lang.String constraints
ConstraintParser.Constraint for details of constraint formats.public abstract java.lang.String[] aliases
public abstract boolean remap
Overwrite methods since it is
anticipated that in general the target of a Overwrite annotation
will be an obfuscated method in the target class. However since it is
possible to also overwrite methods in non-obfuscated targets it may be
necessary to suppress the compiler error which would otherwise be
generated. Setting this value to false will cause the annotation
processor to skip this annotation when attempting to build the
obfuscation table for the mixin.