Method 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 DefaultMethod#nullIfImpossible()
is set to true. The method is declared as public and is invokable unless the instrumented type itself is not visible. Note that
requesting such a method exposes the super method to reflection.
net.bytebuddy.implementation.MethodDelegation , net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder
| Modifier and Type | Class and Description |
|---|---|
| public static enum | DefaultMethod.Binder
A binder for the |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if this method instance should be cached.Indicates if the instance assigned to this parameter should be stored in a static field for reuse. |
| public boolean | Returns: true if null should be assigned if no valid method can be assigned.Indicates that |
| public boolean | Returns: true if this method should be looked up using an java.security.AccessController.Indicates if the instance assigned to this parameter should be looked up using an |
| public Class | Returns: The type declaring the method to invoke orTargetType to indicate that the instrumented method declared the method.Specifies an explicit type that declares the default method to invoke. |
| cached | back to summary |
|---|---|
| public boolean cached() Indicates if the instance assigned to this parameter should be stored in a static field for reuse.
| |
| nullIfImpossible | back to summary |
|---|---|
| public boolean nullIfImpossible() Indicates that
| |
| privileged | back to summary |
|---|---|
| public boolean privileged() Indicates if the instance assigned to this parameter should be looked up using an
| |
| targetType | back to summary |
|---|---|
| public Class Specifies an explicit type that declares the default method to invoke.
| |
DefaultMethod annotation.
| Modifier and Type | Class and Description |
|---|---|
| protected static class | DefaultMethod.Binder.DelegationMethod
Loads the delegation method constant onto the stack. |
| protected static interface | DefaultMethod.Binder.MethodLocator
A method locator is responsible for creating the super method call. |
| Modifier and Type | Field and Description |
|---|---|
| private static final MethodDescription. | CACHED
The |
| public static final DefaultMethod. | INSTANCE
The singleton instance. |
| private static final MethodDescription. | NULL_IF_IMPOSSIBLE
The |
| private static final MethodDescription. | PRIVILEGED
The |
| private static final MethodDescription. | TARGET_TYPE
The |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public MethodDelegationBinder. | bind(final AnnotationDescription.
The annotation that was cause for the delegation to this argument binder. annotation,The intercepted source method. source, ParameterDescription Tge target parameter that is subject to be bound to
intercepting the target, Implementation.source method.The target of the current implementation that is subject to this binding. implementationTarget,An assigner that can be used for applying the binding. assigner, Assigner.The typing to apply. typingImplements net. |
| public Class | getHandledType()
The annotation type that is handled by this parameter binder.
|
| public static DefaultMethod. | |
| public static DefaultMethod. |
| CACHED | back to summary |
|---|---|
| private static final MethodDescription. The | |
| INSTANCE | back to summary |
|---|---|
| public static final DefaultMethod. The singleton instance. | |
| NULL_IF_IMPOSSIBLE | back to summary |
|---|---|
| private static final MethodDescription. The | |
| PRIVILEGED | back to summary |
|---|---|
| private static final MethodDescription. The | |
| TARGET_TYPE | back to summary |
|---|---|
| private static final MethodDescription. The | |
| Binder | back to summary |
|---|---|
| private Binder() | |
| bind | back to summary |
|---|---|
| public MethodDelegationBinder. Implements net. Doc from net. Creates a parameter binding for the given target parameter.
| |
| getHandledType | back to summary |
|---|---|
| public Class The annotation type that is handled by this parameter binder.
| |
| valueOf | back to summary |
|---|---|
| public static DefaultMethod. | |
| values | back to summary |
|---|---|
| public static DefaultMethod. | |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | cached
|
| private final boolean | privileged
|
| private final Implementation. | specialMethodInvocation
The special method invocation that represents the super method call. |
| Access | Constructor and Description |
|---|---|
| protected | DelegationMethod(Implementation.
The special method invocation that represents the super method call. specialMethodInvocation,true if the method constant should be cached.true if the method should be looked up using an java.security.AccessController.Creates a new delegation method. |
| Modifier and Type | Method and Description |
|---|---|
| public StackManipulation. | apply(MethodVisitor
The method visitor used to write the method implementation to. methodVisitor, Implementation.The context of the current implementation. implementationContextImplements net. |
| public boolean | isValid()
Implements net. |
| cached | back to summary |
|---|---|
| private final boolean cached
| |
| privileged | back to summary |
|---|---|
| private final boolean privileged
| |
| specialMethodInvocation | back to summary |
|---|---|
| private final Implementation. The special method invocation that represents the super method call. | |
| DelegationMethod | back to summary |
|---|---|
| protected DelegationMethod(Implementation. Creates a new delegation method.
| |
| apply | back to summary |
|---|---|
| public StackManipulation. Implements net. Doc from net. Applies the stack manipulation that is described by this instance.
| |
| isValid | back to summary |
|---|---|
| public boolean isValid() Implements net. Doc from net. Determines if this stack manipulation is valid.
| |
| Modifier and Type | Class and Description |
|---|---|
| public static class | DefaultMethod.Binder.MethodLocator.ForExplicitType
A method locator for an explicit target type. |
| public static enum | DefaultMethod.Binder.MethodLocator.ForImplicitType
A method locator for an implicit target type. |
| Modifier and Type | Method and Description |
|---|---|
| public Implementation. | Returns: A special method invocation that represents the super call of this binding.The implementation target. implementationTarget,The method being instrumented. source)Resolves the special method invocation to this target. |
| resolve | back to summary |
|---|---|
| public Implementation. Resolves the special method invocation to this target.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final TypeDescription | typeDescription
The explicit target type. |
| Access | Constructor and Description |
|---|---|
| protected | ForExplicitType(TypeDescription
The explicit target type. typeDescription)Creates a method locator for an explicit target. |
| Modifier and Type | Method and Description |
|---|---|
| public Implementation. | resolve(Implementation.
The implementation target. implementationTarget,The method being instrumented. source)Implements net. |
| typeDescription | back to summary |
|---|---|
| private final TypeDescription typeDescription The explicit target type. | |
| ForExplicitType | back to summary |
|---|---|
| protected ForExplicitType(TypeDescription typeDescription) Creates a method locator for an explicit target.
| |
| resolve | back to summary |
|---|---|
| public Implementation. Implements net. Doc from net. Resolves the special method invocation to this target.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final DefaultMethod. | INSTANCE
The singleton instance. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Implementation. | resolve(Implementation.
The implementation target. implementationTarget,The method being instrumented. source)Implements net. |
| public static DefaultMethod. | |
| public static DefaultMethod. |
| INSTANCE | back to summary |
|---|---|
| public static final DefaultMethod. The singleton instance. | |
| ForImplicitType | back to summary |
|---|---|
| private ForImplicitType() | |
| resolve | back to summary |
|---|---|
| public Implementation. Implements net. Doc from net. Resolves the special method invocation to this target.
| |
| valueOf | back to summary |
|---|---|
| public static DefaultMethod. | |
| values | back to summary |
|---|---|
| public static DefaultMethod. | |