Package net.bytebuddy.implementation
Class Implementation.Context.Default.FieldGetterDelegation
- java.lang.Object
-
- net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool.Record.ForDefinedMethod
-
- net.bytebuddy.implementation.Implementation.Context.Default.DelegationRecord
-
- net.bytebuddy.implementation.Implementation.Context.Default.FieldGetterDelegation
-
- All Implemented Interfaces:
TypeWriter.MethodPool.Record
,ByteCodeAppender
- Enclosing class:
- Implementation.Context.Default
@Enhance protected static class Implementation.Context.Default.FieldGetterDelegation extends Implementation.Context.Default.DelegationRecord
An implementation for a field getter.
-
-
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
Fields Modifier and Type Field Description private FieldDescription
fieldDescription
The field to read from.-
Fields inherited from class net.bytebuddy.implementation.Implementation.Context.Default.DelegationRecord
methodDescription, visibility
-
-
Constructor Summary
Constructors Modifier Constructor Description private
FieldGetterDelegation(MethodDescription.InDefinedShape methodDescription, Visibility visibility, FieldDescription fieldDescription)
Creates a new field getter implementation.protected
FieldGetterDelegation(TypeDescription instrumentedType, java.lang.String suffix, MethodAccessorFactory.AccessType accessType, FieldDescription fieldDescription)
Creates a new field getter implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteCodeAppender.Size
apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod)
Applies this byte code appender to a type creation process.protected Implementation.Context.Default.DelegationRecord
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 Detail
-
fieldDescription
private final FieldDescription fieldDescription
The field to read from.
-
-
Constructor Detail
-
FieldGetterDelegation
protected FieldGetterDelegation(TypeDescription instrumentedType, java.lang.String suffix, MethodAccessorFactory.AccessType accessType, FieldDescription fieldDescription)
Creates a new field getter implementation.- Parameters:
instrumentedType
- The instrumented type.suffix
- The suffix to use for the setter method.accessType
- The method's access type.fieldDescription
- The field to write to.
-
FieldGetterDelegation
private FieldGetterDelegation(MethodDescription.InDefinedShape methodDescription, Visibility visibility, FieldDescription fieldDescription)
Creates a new field getter implementation.- Parameters:
methodDescription
- The delegation method.visibility
- The delegation method's visibility.fieldDescription
- The field to read.
-
-
Method Detail
-
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.
-
-