Annotation Type DefaultMethod
-
@Documented @Retention(RUNTIME) @Target(PARAMETER) public @interface DefaultMethod
A parameter with this annotation is assigned an instance ofMethodwhich 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. The method is declared aspublicand is invokable unless the instrumented type itself is not visible. Note that requesting such a method exposes the super method to reflection.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleancachedIndicates if the instance assigned to this parameter should be stored in a static field for reuse.booleannullIfImpossibleIndicates thatnullshould be assigned to this parameter if no default method is invokable.booleanprivilegedIndicates if the instance assigned to this parameter should be looked up using anAccessController.Class<?>targetTypeSpecifies an explicit type that declares the default method to invoke.
-
-
-
-
privileged
boolean privileged
Indicates if the instance assigned to this parameter should be looked up using anAccessController.- Returns:
trueif this method should be looked up using anAccessController.
- Default:
- false
-
-
-
targetType
Class<?> targetType
Specifies an explicit type that declares the default method to invoke.- Returns:
- The type declaring the method to invoke or
TargetTypeto indicate that the instrumented method declared the method.
- Default:
- void.class
-
-