Class Implementation.Context.Default.FieldSetterDelegation
java.lang.Object
net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool.Record.ForDefinedMethod
net.bytebuddy.implementation.Implementation.Context.Default.DelegationRecord
net.bytebuddy.implementation.Implementation.Context.Default.FieldSetterDelegation
- All Implemented Interfaces:
TypeWriter.MethodPool.Record, ByteCodeAppender
- Enclosing class:
Implementation.Context.Default
@Enhance
protected static class Implementation.Context.Default.FieldSetterDelegation
extends Implementation.Context.Default.DelegationRecord
An implementation for a field setter.
-
Nested Class Summary
Nested classes/interfaces inherited from class TypeWriter.MethodPool.Record.ForDefinedMethod
TypeWriter.MethodPool.Record.ForDefinedMethod.OfVisibilityBridge, TypeWriter.MethodPool.Record.ForDefinedMethod.WithAnnotationDefaultValue, TypeWriter.MethodPool.Record.ForDefinedMethod.WithBody, TypeWriter.MethodPool.Record.ForDefinedMethod.WithoutBodyNested classes/interfaces inherited from interface ByteCodeAppender
ByteCodeAppender.Compound, ByteCodeAppender.Simple, ByteCodeAppender.SizeNested classes/interfaces inherited from interface TypeWriter.MethodPool.Record
TypeWriter.MethodPool.Record.AccessBridgeWrapper, TypeWriter.MethodPool.Record.ForDefinedMethod, TypeWriter.MethodPool.Record.ForNonImplementedMethod, TypeWriter.MethodPool.Record.Sort -
Field Summary
FieldsFields inherited from class Implementation.Context.Default.DelegationRecord
methodDescription, visibility -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateFieldSetterDelegation(MethodDescription.InDefinedShape methodDescription, Visibility visibility, FieldDescription fieldDescription) Creates a new field setter.protectedFieldSetterDelegation(TypeDescription instrumentedType, String suffix, MethodAccessorFactory.AccessType accessType, FieldDescription fieldDescription) Creates a new field setter implementation. -
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 Implementation.Context.Default.DelegationRecord
applyAttributes, applyBody, applyCode, applyHead, getMethod, getSort, getVisibility, prependMethods inherited from class TypeWriter.MethodPool.Record.ForDefinedMethod
apply
-
Field Details
-
fieldDescription
The field to write to.
-
-
Constructor Details
-
FieldSetterDelegation
protected FieldSetterDelegation(TypeDescription instrumentedType, String suffix, MethodAccessorFactory.AccessType accessType, FieldDescription fieldDescription) Creates a new field setter 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.
-
FieldSetterDelegation
private FieldSetterDelegation(MethodDescription.InDefinedShape methodDescription, Visibility visibility, FieldDescription fieldDescription) Creates a new field setter.- Parameters:
methodDescription- The field accessor method.visibility- The delegation method's visibility.fieldDescription- The field to write to.
-
-
Method Details
-
with
protected Implementation.Context.Default.DelegationRecord with(MethodAccessorFactory.AccessType accessType) Description copied from class:Implementation.Context.Default.DelegationRecordReturns this delegation record with the minimal visibility represented by the supplied access type.- Specified by:
within 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.
-