Class Morph.Binder.RedirectionProxy
- java.lang.Object
-
- net.bytebuddy.implementation.bind.annotation.Morph.Binder.RedirectionProxy
-
- All Implemented Interfaces:
AuxiliaryType,StackManipulation
- Enclosing class:
- Morph.Binder
@Enhance protected static class Morph.Binder.RedirectionProxy extends java.lang.Object implements AuxiliaryType, StackManipulation
A proxy that implements the installed interface in order to allow for a morphed super method invocation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classMorph.Binder.RedirectionProxy.InstanceFieldConstructorCreates an instance of the proxy when instrumenting an instance method.protected static classMorph.Binder.RedirectionProxy.MethodCallImplements a the method call of the morphing method.protected static classMorph.Binder.RedirectionProxy.StaticFieldConstructorCreates an instance of the proxy when instrumenting a static method.-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.auxiliary.AuxiliaryType
AuxiliaryType.NamingStrategy, AuxiliaryType.SignatureRelevant
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.StackManipulation
StackManipulation.Compound, StackManipulation.Illegal, StackManipulation.Size, StackManipulation.Trivial
-
-
Field Summary
Fields Modifier and Type Field Description private AssignerassignerThe assigner to use.protected static java.lang.StringFIELD_NAMEThe name of the field that carries an instance for invoking a super method on.private TypeDescriptioninstrumentedTypeThe type that is instrumented on which the super method is invoked.private TypeDescriptionmorphingTypeThe interface type that is implemented by the generated proxy.private booleanserializableProxyDetermines if the generated proxy should beSerializable.private Implementation.SpecialMethodInvocationspecialMethodInvocationThe special method invocation to be executed by the morphing type via an accessor on the instrumented type.-
Fields inherited from interface net.bytebuddy.implementation.auxiliary.AuxiliaryType
DEFAULT_TYPE_MODIFIER
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRedirectionProxy(TypeDescription morphingType, TypeDescription instrumentedType, Implementation.SpecialMethodInvocation specialMethodInvocation, Assigner assigner, boolean serializableProxy)Creates a new redirection proxy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StackManipulation.Sizeapply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)Applies the stack manipulation that is described by this instance.booleanisValid()Determines if this stack manipulation is valid.DynamicTypemake(java.lang.String auxiliaryTypeName, ClassFileVersion classFileVersion, MethodAccessorFactory methodAccessorFactory)Creates a new auxiliary type.
-
-
-
Field Detail
-
FIELD_NAME
protected static final java.lang.String FIELD_NAME
The name of the field that carries an instance for invoking a super method on.- See Also:
- Constant Field Values
-
morphingType
private final TypeDescription morphingType
The interface type that is implemented by the generated proxy.
-
instrumentedType
private final TypeDescription instrumentedType
The type that is instrumented on which the super method is invoked.
-
specialMethodInvocation
private final Implementation.SpecialMethodInvocation specialMethodInvocation
The special method invocation to be executed by the morphing type via an accessor on the instrumented type.
-
assigner
private final Assigner assigner
The assigner to use.
-
serializableProxy
private final boolean serializableProxy
Determines if the generated proxy should beSerializable.
-
-
Constructor Detail
-
RedirectionProxy
protected RedirectionProxy(TypeDescription morphingType, TypeDescription instrumentedType, Implementation.SpecialMethodInvocation specialMethodInvocation, Assigner assigner, boolean serializableProxy)
Creates a new redirection proxy.- Parameters:
morphingType- The interface type that is implemented by the generated proxy.instrumentedType- The type that is instrumented on which the super method is invoked.specialMethodInvocation- The special method invocation to be executed by the morphing type via an accessor on the instrumented type.assigner- The assigner to use.serializableProxy-trueif the proxy should be serializable.
-
-
Method Detail
-
make
public DynamicType make(java.lang.String auxiliaryTypeName, ClassFileVersion classFileVersion, MethodAccessorFactory methodAccessorFactory)
Creates a new auxiliary type.- Specified by:
makein interfaceAuxiliaryType- Parameters:
auxiliaryTypeName- The fully qualified binary name for this auxiliary type. The type should be in the same package than the instrumented type this auxiliary type is providing services to in order to allow package-private access.classFileVersion- The class file version the auxiliary class should be written in.methodAccessorFactory- A factory for accessor methods.- Returns:
- A dynamically created type representing this auxiliary type.
-
isValid
public boolean isValid()
Determines if this stack manipulation is valid.- Specified by:
isValidin interfaceStackManipulation- Returns:
- If
false, this manipulation cannot be applied and should throw an exception.
-
apply
public StackManipulation.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)
Applies the stack manipulation that is described by this instance.- Specified by:
applyin interfaceStackManipulation- Parameters:
methodVisitor- The method visitor used to write the method implementation to.implementationContext- The context of the current implementation.- Returns:
- The changes to the size of the operand stack that are implied by this stack manipulation.
-
-