Annotation Interface DefaultMethodHandle
A parameter with this annotation is assigned an instance of
java.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 unless nullIfImpossible()
is set to true
.
Note that requesting such a method exposes the default method to reflective access.- See Also:
-
Nested Class Summary
Nested Classes -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
Indicates thatnull
should be assigned to this parameter if no default method is invokable.Class
<?> Specifies an explicit type that declares the default method to invoke.
-
Element Details
-
targetType
Class<?> targetTypeSpecifies 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
-
nullIfImpossible
boolean nullIfImpossibleIndicates thatnull
should be assigned to this parameter if no default method is invokable.- Returns:
true
ifnull
should be assigned if no valid method can be assigned.
- Default:
false
-