Package net.bytebuddy.asm
Annotation Type Advice.Origin
-
@Documented @Retention(RUNTIME) @Target(PARAMETER) public static @interface Advice.OriginIndicates that the annotated parameter should be mapped to a string representation of the instrumented method, a constant representing the
Classdeclaring the adviced method or aMethod,Constructororjava.lang.reflect.Executablerepresenting this method. It can also load the instrumented method'sjava.lang.invoke.MethodType,java.lang.invoke.MethodHandleorjava.lang.invoke.MethodHandles$Lookup. Finally, it can be a primitive integer to represent the origin's modifiers.Note: A constant representing a
MethodorConstructoris not cached but is recreated for every read.Important: Don't confuse this annotation with
OriginorMemberSubstitution.Origin. This annotation should be used only in combination withAdvice.- See Also:
Advice,Advice.OnMethodEnter,Advice.OnMethodExit
-
-
Field Summary
Fields Modifier and Type Fields Description static java.lang.StringDEFAULTIndicates that the origin string should be indicated by theObject.toString()representation of the instrumented method.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.StringvalueReturns the pattern the annotated parameter should be assigned.
-
-
-
Element Detail
-
value
java.lang.String value
Returns the pattern the annotated parameter should be assigned. By default, theAnnotation.toString()representation of the method is assigned. Alternatively, a pattern can be assigned where:#tinserts the method's declaring type.#minserts the name of the method (<init>for constructors and<clinit>for static initializers).#dfor the method's descriptor.#sfor the method's signature.#rfor the method's return type.#pfor 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 typeClass.- Returns:
- The pattern the annotated parameter should be assigned.
- Default:
- ""
-
-