Skip to main content

Common Mixin Symbols

This page introduces the basic symbols used by Mixin (some of them come from the JVM itself).

Field Descriptors​

Oracle defines the following field descriptors:

DescriptorOriginal typeDescription
BbyteSigned byte
CcharUnicode code point in the Basic Multilingual Plane, encoded with UTF-16
DdoubleDouble-precision floating-point value
FfloatSingle-precision floating-point value
IintInteger
JlongLong integer
Lclass name;referenceAn instance of class name (note the semicolon)
SshortSigned short
Zbooleantrue or false
[referenceOne array dimension

A method descriptor consists of the method name, followed by a pair of parentheses containing the argument types, then the return type. For example, the Java method Object m(int i, double[] d, Thread t) has the method descriptor m(I[DLjava/lang/Thread;)Ljava/lang/Object;.

Method Targeting​

Every annotation uses a method parameter, which normally takes a method descriptor.

If only one method has the given name, you can use the method name directly without the full descriptor.

Injection Point Reference​

The Injection Point Reference defines which part of the target method's body is used. The table below describes several options:

NameDescription
HEADTop of the method
RETURNBefore a return statement
TAILBefore the final return statement
INVOKEAt an instance method call
INVOKE_ASSIGNAt a static method call
INVOKE_STRINGAt a method call with a single argument
FIELDAt a field access

When the injection point refers to a statement or member, the target is set in @At. The target value uses JVM bytecode descriptors (that is, field descriptors).