Annotation Type DefaultMethodHandle
-
@Documented @Retention(RUNTIME) @Target(PARAMETER) public @interface DefaultMethodHandle
A parameter with this annotation is assigned an instance ofjava.lang.invoke.MethodHandle
which invokes a default method implementation of this method. If such a method is not available, this annotation causes that this delegation target cannot be bound unlessnullIfImpossible()
is set totrue
. Note that requesting such a method exposes the default method to reflective access.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
nullIfImpossible
Indicates thatnull
should be assigned to this parameter if no default method is invokable.java.lang.Class<?>
targetType
Specifies an explicit type that declares the default method to invoke.
-
-
-
Element Detail
-
targetType
java.lang.Class<?> targetType
Specifies an explicit type that declares the default method to invoke.- Returns:
- The type declaring the method to invoke or
TargetType
to indicate that the instrumented method declared the method.
- Default:
- void.class
-
-