Package net.bytebuddy.implementation
Class Implementation.Context.Default.AccessorMethodDelegation
java.lang.Object
net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool.Record.ForDefinedMethod
net.bytebuddy.implementation.Implementation.Context.Default.DelegationRecord
net.bytebuddy.implementation.Implementation.Context.Default.AccessorMethodDelegation
- All Implemented Interfaces:
TypeWriter.MethodPool.Record
,ByteCodeAppender
- Enclosing class:
- Implementation.Context.Default
@Enhance
protected static class Implementation.Context.Default.AccessorMethodDelegation
extends Implementation.Context.Default.DelegationRecord
An implementation of a
TypeWriter.MethodPool.Record
for implementing
an accessor method.-
Nested Class Summary
Nested classes/interfaces inherited from class net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool.Record.ForDefinedMethod
TypeWriter.MethodPool.Record.ForDefinedMethod.OfVisibilityBridge, TypeWriter.MethodPool.Record.ForDefinedMethod.WithAnnotationDefaultValue, TypeWriter.MethodPool.Record.ForDefinedMethod.WithBody, TypeWriter.MethodPool.Record.ForDefinedMethod.WithoutBody
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.ByteCodeAppender
ByteCodeAppender.Compound, ByteCodeAppender.Simple, ByteCodeAppender.Size
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool.Record
TypeWriter.MethodPool.Record.AccessBridgeWrapper, TypeWriter.MethodPool.Record.ForDefinedMethod, TypeWriter.MethodPool.Record.ForNonImplementedMethod, TypeWriter.MethodPool.Record.Sort
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StackManipulation
The stack manipulation that represents the requested special method invocation.Fields inherited from class net.bytebuddy.implementation.Implementation.Context.Default.DelegationRecord
methodDescription, visibility
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
AccessorMethodDelegation
(MethodDescription.InDefinedShape methodDescription, Visibility visibility, StackManipulation accessorMethodInvocation) Creates a delegation to an accessor method.protected
AccessorMethodDelegation
(TypeDescription instrumentedType, String suffix, MethodAccessorFactory.AccessType accessType, Implementation.SpecialMethodInvocation specialMethodInvocation) Creates a delegation to an accessor method. -
Method Summary
Modifier and TypeMethodDescriptionapply
(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod) Applies this byte code appender to a type creation process.with
(MethodAccessorFactory.AccessType accessType) Returns this delegation record with the minimal visibility represented by the supplied access type.Methods inherited from class net.bytebuddy.implementation.Implementation.Context.Default.DelegationRecord
applyAttributes, applyBody, applyCode, applyHead, getMethod, getSort, getVisibility, prepend
Methods inherited from class net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool.Record.ForDefinedMethod
apply
-
Field Details
-
accessorMethodInvocation
The stack manipulation that represents the requested special method invocation.
-
-
Constructor Details
-
AccessorMethodDelegation
protected AccessorMethodDelegation(TypeDescription instrumentedType, String suffix, MethodAccessorFactory.AccessType accessType, Implementation.SpecialMethodInvocation specialMethodInvocation) Creates a delegation to an accessor method.- Parameters:
instrumentedType
- The instrumented type.suffix
- The suffix to append to the method.accessType
- The access type.specialMethodInvocation
- The actual method's invocation.
-
AccessorMethodDelegation
private AccessorMethodDelegation(MethodDescription.InDefinedShape methodDescription, Visibility visibility, StackManipulation accessorMethodInvocation) Creates a delegation to an accessor method.- Parameters:
methodDescription
- The accessor method.visibility
- The method's visibility.accessorMethodInvocation
- The actual method's invocation.
-
-
Method Details
-
with
protected Implementation.Context.Default.DelegationRecord with(MethodAccessorFactory.AccessType accessType) Description copied from class:Implementation.Context.Default.DelegationRecord
Returns this delegation record with the minimal visibility represented by the supplied access type.- Specified by:
with
in classImplementation.Context.Default.DelegationRecord
- Parameters:
accessType
- The access type to enforce.- Returns:
- A new version of this delegation record with the minimal implied visibility.
-
apply
public ByteCodeAppender.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod) Applies this byte code appender to a type creation process.- Parameters:
methodVisitor
- The method visitor to which the byte code appender writes its code to.implementationContext
- The implementation context of the current type creation process.instrumentedMethod
- The method that is the target of the instrumentation.- Returns:
- The required size for the applied byte code to run.
-