Class TypeProxy.ForDefaultMethod
- java.lang.Object
-
- net.bytebuddy.implementation.auxiliary.TypeProxy.ForDefaultMethod
-
- All Implemented Interfaces:
StackManipulation
- Enclosing class:
- TypeProxy
@Enhance public static class TypeProxy.ForDefaultMethod extends java.lang.Object implements StackManipulation
Creates a type proxy which delegates its super method calls to any invokable default method of a given interface and loads an instance of this proxy onto the operand stack.
-
-
Nested Class Summary
-
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 Implementation.TargetimplementationTargetThe implementation target for the original instrumentation.private TypeDescriptionproxiedTypeThe proxied interface type.private booleanserializableProxytrueif the proxy should beSerializable.
-
Constructor Summary
Constructors Constructor Description ForDefaultMethod(TypeDescription proxiedType, Implementation.Target implementationTarget, boolean serializableProxy)Creates a new proxy creation for a default interface type 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.
-
-
-
Field Detail
-
proxiedType
private final TypeDescription proxiedType
The proxied interface type.
-
implementationTarget
private final Implementation.Target implementationTarget
The implementation target for the original instrumentation.
-
serializableProxy
private final boolean serializableProxy
trueif the proxy should beSerializable.
-
-
Constructor Detail
-
ForDefaultMethod
public ForDefaultMethod(TypeDescription proxiedType, Implementation.Target implementationTarget, boolean serializableProxy)
Creates a new proxy creation for a default interface type proxy.- Parameters:
proxiedType- The proxied interface type.implementationTarget- The implementation target for the original implementation.serializableProxy-trueif the proxy should beSerializable.
-
-
Method Detail
-
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.
-
-