Top Description Inners Methods
org.easymock.bytebuddy.implementation.bind.annotation

public @Interface SuperMethod

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:PARAMETER
Imports
org.easymock.bytebuddy.build.HashCodeAndEqualsPlugin, org.easymock.bytebuddy.description.annotation.AnnotationDescription, org.easymock.bytebuddy.description.method.MethodDescription, .MethodList, .ParameterDescription, org.easymock.bytebuddy.description.type.TypeDescription, org.easymock.bytebuddy.implementation.Implementation, .MethodAccessorFactory, org.easymock.bytebuddy.implementation.bind.MethodDelegationBinder, org.easymock.bytebuddy.implementation.bytecode.StackManipulation, org.easymock.bytebuddy.implementation.bytecode.assign.Assigner, org.easymock.bytebuddy.implementation.bytecode.constant.MethodConstant, .NullConstant, org.easymock.bytebuddy.implementation.bytecode.member.FieldAccess, org.easymock.bytebuddy.jar.asm.MethodVisitor, java.lang.annotation.*, java.lang.reflect.Method

A parameter with this annotation is assigned an instance of Method which invokes the super implementation of this method. If such a method is not available, this annotation causes that this delegation target cannot be bound unless SuperMethod#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.
See Also
net.bytebuddy.implementation.MethodDelegation, net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
SuperMethod.Binder

A binder for the SuperMethod annotation.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if this method instance should be cached.
cached
()

Indicates if the instance assigned to this parameter should be stored in a static field for reuse.

public boolean

Returns:

true if a default method should be invoked if it is not ambiguous and no super class method is available.
fallbackToDefault
()

Indicates that the assigned method should attempt the invocation of an unambiguous default method if no super method is available.

public boolean

Returns:

true if null should be assigned if no valid method can be assigned.
nullIfImpossible
()

Indicates that null should be assigned to this parameter if no super method is invokable.

public boolean

Returns:

true if this method should be looked up using an java.security.AccessController.
privileged
()

Indicates if the instance assigned to this parameter should be looked up using an java.security.AccessController.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

cachedback to summary
public boolean cached()

Indicates if the instance assigned to this parameter should be stored in a static field for reuse.

Returns:boolean

true if this method instance should be cached.

fallbackToDefaultback to summary
public boolean fallbackToDefault()

Indicates that the assigned method should attempt the invocation of an unambiguous default method if no super method is available.

Returns:boolean

true if a default method should be invoked if it is not ambiguous and no super class method is available.

nullIfImpossibleback to summary
public boolean nullIfImpossible()

Indicates that null should be assigned to this parameter if no super method is invokable.

Returns:boolean

true if null should be assigned if no valid method can be assigned.

privilegedback to summary
public boolean privileged()

Indicates if the instance assigned to this parameter should be looked up using an java.security.AccessController.

Returns:boolean

true if this method should be looked up using an java.security.AccessController.

org.easymock.bytebuddy.implementation.bind.annotation back to summary

public final Enum SuperMethod.Binder

extends Enum<SuperMethod.Binder>
implements TargetMethodAnnotationDrivenBinder.ParameterBinder<SuperMethod>
Class Inheritance
All Implemented Interfaces
org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder

A binder for the SuperMethod annotation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
SuperMethod.Binder.DelegationMethod

Loads the delegation method constant onto the stack.

Field Summary

Modifier and TypeField and Description
private static final MethodDescription.InDefinedShape
CACHED

A description of the SuperMethod#cached() method.

private static final MethodDescription.InDefinedShape
public static final SuperMethod.Binder
INSTANCE

The singleton instance.

private static final MethodDescription.InDefinedShape
private static final MethodDescription.InDefinedShape
PRIVILEGED

A description of the SuperMethod#privileged() method.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public MethodDelegationBinder.ParameterBinding<?>
bind(AnnotationDescription.Loadable<SuperMethod>
The annotation that was cause for the delegation to this argument binder.
annotation
,
MethodDescription
The intercepted source method.
source
,
ParameterDescription
Tge target parameter that is subject to be bound to intercepting the source method.
target
,
Implementation.Target
The target of the current implementation that is subject to this binding.
implementationTarget
,
Assigner
An assigner that can be used for applying the binding.
assigner
,
Assigner.Typing
The typing to apply.
typing
)

Implements org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.bind.

Creates a parameter binding for the given target parameter.
public Class<SuperMethod>
public static SuperMethod.Binder
public static SuperMethod.Binder[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CACHEDback to summary
private static final MethodDescription.InDefinedShape CACHED

A description of the SuperMethod#cached() method.

FALLBACK_TO_DEFAULTback to summary
private static final MethodDescription.InDefinedShape FALLBACK_TO_DEFAULT

A description of the SuperMethod#fallbackToDefault() method.

INSTANCEback to summary
public static final SuperMethod.Binder INSTANCE

The singleton instance.

NULL_IF_IMPOSSIBLEback to summary
private static final MethodDescription.InDefinedShape NULL_IF_IMPOSSIBLE

A description of the SuperMethod#nullIfImpossible() method.

PRIVILEGEDback to summary
private static final MethodDescription.InDefinedShape PRIVILEGED

A description of the SuperMethod#privileged() method.

Constructor Detail

Binderback to summary
private Binder()

Method Detail

bindback to summary
public MethodDelegationBinder.ParameterBinding<?> bind(AnnotationDescription.Loadable<SuperMethod> annotation, MethodDescription source, ParameterDescription target, Implementation.Target implementationTarget, Assigner assigner, Assigner.Typing typing)

Implements org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.bind.

Doc from org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.bind.

Creates a parameter binding for the given target parameter.

Parameters
annotation:AnnotationDescription.Loadable<SuperMethod>

The annotation that was cause for the delegation to this argument binder.

source:MethodDescription

The intercepted source method.

target:ParameterDescription

Tge target parameter that is subject to be bound to intercepting the source method.

implementationTarget:Implementation.Target

The target of the current implementation that is subject to this binding.

assigner:Assigner

An assigner that can be used for applying the binding.

typing:Assigner.Typing

The typing to apply.

Returns:MethodDelegationBinder.ParameterBinding<?>

A parameter binding for the requested target method parameter.

getHandledTypeback to summary
public Class<SuperMethod> getHandledType()

Implements org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.getHandledType.

Doc from org.easymock.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder.getHandledType.

The annotation type that is handled by this parameter binder.

Returns:Class<SuperMethod>

The java.lang.annotation.Annotation#annotationType() handled by this parameter binder.

valueOfback to summary
public static SuperMethod.Binder valueOf(String name)
valuesback to summary
public static SuperMethod.Binder[] values()
org.easymock.bytebuddy.implementation.bind.annotation back to summary

protected Class SuperMethod.Binder.DelegationMethod

extends Object
implements StackManipulation
Class Inheritance
  • java.lang.Object
  • org.easymock.bytebuddy.implementation.bind.annotation.SuperMethod.Binder.DelegationMethod
All Implemented Interfaces
org.easymock.bytebuddy.implementation.bytecode.StackManipulation
Annotations
@Enhance

Loads the delegation method constant onto the stack.

Field Summary

Modifier and TypeField and Description
private final boolean
cached

true if the method constant should be cached.

private final boolean
privileged

true if this method should be looked up using an java.security.AccessController.

private final Implementation.SpecialMethodInvocation
specialMethodInvocation

The special method invocation that represents the super method call.

Constructor Summary

AccessConstructor and Description
protected
DelegationMethod(Implementation.SpecialMethodInvocation
The special method invocation that represents the super method call.
specialMethodInvocation
,
boolean
true if the method constant should be cached.
cached
,
boolean
true if this method should be looked up using an java.security.AccessController.
privileged
)

Creates a new delegation method.

Method Summary

Modifier and TypeMethod and Description
public StackManipulation.Size
apply(MethodVisitor
The method visitor used to write the method implementation to.
methodVisitor
,
Implementation.Context
The context of the current implementation.
implementationContext
)

Implements org.easymock.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.
public boolean
isValid()

Implements org.easymock.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Determines if this stack manipulation is valid.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cachedback to summary
private final boolean cached

true if the method constant should be cached.

privilegedback to summary
private final boolean privileged

true if this method should be looked up using an java.security.AccessController.

specialMethodInvocationback to summary
private final Implementation.SpecialMethodInvocation specialMethodInvocation

The special method invocation that represents the super method call.

Constructor Detail

DelegationMethodback to summary
protected DelegationMethod(Implementation.SpecialMethodInvocation specialMethodInvocation, boolean cached, boolean privileged)

Creates a new delegation method.

Parameters
specialMethodInvocation:Implementation.SpecialMethodInvocation

The special method invocation that represents the super method call.

cached:boolean

true if the method constant should be cached.

privileged:boolean

true if this method should be looked up using an java.security.AccessController.

Method Detail

applyback to summary
public StackManipulation.Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext)

Implements org.easymock.bytebuddy.implementation.bytecode.StackManipulation.apply.

Doc from org.easymock.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.

Parameters
methodVisitor:MethodVisitor

The method visitor used to write the method implementation to.

implementationContext:Implementation.Context

The context of the current implementation.

Returns:StackManipulation.Size

The changes to the size of the operand stack that are implied by this stack manipulation.

isValidback to summary
public boolean isValid()

Implements org.easymock.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Doc from org.easymock.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Determines if this stack manipulation is valid.

Returns:boolean

If false, this manipulation cannot be applied and should throw an exception.