@Target(value={})
@Retention(value=RUNTIME)
public @interface At
InjectionPoint to use to
perform an Inject process. This annotation allows the
InjectionPoint class to be specified, as well as arguments to be
passed to the InjectionPoint instance to configure it. The data
contained in the annotation are wrapped into a
InjectionInfo object before being passed to the InjectionPoint for
parsing. All values are optional apart from value(), which specifies
the type of InjectionPoint to use. All other parameters depend on the
InjectionPoint chosen, and the javadoc for each InjectionPoint class
should be consulted for the meaning of the argument to that particular class.
A general description of each parameter is provided below.| Modifier and Type | Required Element and Description |
|---|---|
java.lang.String |
value
Type of
InjectionPoint to use. |
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.String[] |
args
The named arguments list is used to expand the scope of the
annotation beyond the fixed values below in order to accommodate the
needs of custom injection point classes.
|
int |
by
|
java.lang.String |
id
The identifier for this injection point, can be retrieved via the
CallbackInfo.getId() accessor. |
int |
opcode
Target opcode for FIELD and JUMP InjectionPoints.
|
int |
ordinal
Ordinal offset.
|
boolean |
remap
|
At.Shift |
shift
Shift type for returned opcodes.
|
java.lang.String |
slice
For
Inject queries, this specifies the ID of the slice to use for
this query. |
java.lang.String |
target
Target identifier used by INVOKE, INVOKE_STRING, INVOKE_ASSIGN, FIELD and
NEW.
|
public abstract java.lang.String value
Type of InjectionPoint to use. Can be a built-in class or the
fully-qualified name of a custom class which extends
InjectionPoint.
Built-in types are
HEAD,
RETURN,
TAIL,
INVOKE,
INVOKE_ASSIGN,
FIELD,
NEW,
INVOKE_STRING,
JUMP and
CONSTANT.
See the javadoc for each type for more details on the scheme used by each
injection point.
public abstract java.lang.String id
CallbackInfo.getId() accessor. If specified, the ID is appended to
the value specified in the outer annotion. Eg. specifying "foo" for this
attribute and "bar" for the Inject.Inject.id() attribute
will result in a combined id of "bar:foo". Note that if no id
is specified for the outer injector, the name of the calling method is
used.public abstract java.lang.String slice
Inject queries, this specifies the ID of the slice to use for
this query. For other injector types it is ignored because only one slice
is supported.
For more details see the Slice.id()
public abstract At.Shift shift
AFTER with an INVOKE InjectionPoint to move the returned opcodes to
after the invoation. Use BY in conjunction
with the by() parameter to shift by an arbitrary number of
opcodes.public abstract int by
shift() is specified as BY, specifies the
number of opcodes to shift by (negative numbers are allowed). Note that
values above 3 should be avoided and in general either replaced
with a custom injection point or with sliced injection points. The
warning/error threshold is defined by the config (with a hard limit on
value of InjectionPoint.MAX_ALLOWED_SHIFT_BY)BY shiftpublic abstract java.lang.String[] args
The named arguments list is used to expand the scope of the annotation beyond the fixed values below in order to accommodate the needs of custom injection point classes.
public abstract java.lang.String target
public abstract int ordinal
public abstract int opcode
public abstract boolean remap
target() member and any other
args() known to contain potentially obfuscated references, since
it is anticipated that in general the target of an At annotation
will be an obfuscated method or field. However since it is also possible
that the target is a non-obfuscated reference 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.