@Documented @Retention(value=RUNTIME) @Target(value=PARAMETER) public @interface Origin
The origin annotation provides some meta information about the source method that is bound to this method where the binding is dependant of the parameter's type:
java.lang.reflect.Executable, the parameter is assigned a reference to the method or constructor it instruments. If the reference is not assignable to the sort of the intercepted source, the target is not considered for binding.
Class, the parameter is assigned a reference of the type of the instrumented type.
String, the parameter is assigned a string with the value that would be returned by the
inttype, it is assigned the intercepted method's modifiers.
java.lang.invoke.MethodHandle, a handle of the intercepted method is injected. A
java.lang.invoke.MethodHandleis stored in a class's constant pool and does therefore not face the same runtime performance limitations as a (non-cached)
Methodreference. Method handles are only supported for byte code versions starting from Java 7.
java.lang.invoke.MethodType, a description of the intercepted method's type is injected. Method type descriptions are only supported for byte code versions starting from Java 7.
Any other parameter type will cause an
Important: A method handle or method type reference can only be used if the referenced method's types are all visible
to the instrumented type or an
IllegalAccessError will be thrown at runtime.
|Modifier and Type||Optional Element and Description|
Determines if the value that is assigned by this annotation is cached.
Determines if the method should be resolved by using an
public abstract boolean cache
trueif the value for this parameter should be cached in a
staticfield inside the instrumented class.
public abstract boolean privileged
AccessControllerusing the privileges of the generated class. Doing so requires the generation of an auxiliary class that implements
trueif the class should be looked up using an
Copyright © 2014–2019. All rights reserved.