@Documented @Retention(value=RUNTIME) @Target(value=PARAMETER) public static @interface Advice.Origin
Indicates that the annotated parameter should be mapped to a string representation of the instrumented method,
a constant representing the Class
declaring the adviced method or a Method
, Constructor
or java.lang.reflect.Executable
representing this method. It can also load the instrumented method's
java.lang.invoke.MethodType
, java.lang.invoke.MethodHandle
or
java.lang.invoke.MethodHandles$Lookup
.
Note: A constant representing a Method
or Constructor
is not cached but is recreated for
every read.
Important: Don't confuse this annotation with Origin
or
MemberSubstitution.Origin
. This annotation should
be used only in combination with Advice
.
Advice
,
Advice.OnMethodEnter
,
Advice.OnMethodExit
Modifier and Type | Fields and Description |
---|---|
static String |
DEFAULT
Indicates that the origin string should be indicated by the
Object.toString() representation of the instrumented method. |
public static final String DEFAULT
Object.toString()
representation of the instrumented method.public abstract String value
Annotation.toString()
representation
of the method is assigned. Alternatively, a pattern can be assigned where:
#t
inserts the method's declaring type.#m
inserts the name of the method (<init>
for constructors and <clinit>
for static initializers).#d
for the method's descriptor.#s
for the method's signature.#r
for the method's return type.#p
for the property's name.#
character must be escaped by \
which can be escaped by itself. This property is ignored if the annotated
parameter is of type Class
.Copyright © 2014–2023. All rights reserved.