Package net.bytebuddy.implementation
Class Implementation.Context.Default.DelegationRecord
java.lang.Object
net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool.Record.ForDefinedMethod
net.bytebuddy.implementation.Implementation.Context.Default.DelegationRecord
- All Implemented Interfaces:
TypeWriter.MethodPool.Record,ByteCodeAppender
- Direct Known Subclasses:
Implementation.Context.Default.AccessorMethodDelegation,Implementation.Context.Default.FieldGetterDelegation,Implementation.Context.Default.FieldSetterDelegation
- Enclosing class:
Implementation.Context.Default
@Enhance
protected abstract static class Implementation.Context.Default.DelegationRecord
extends TypeWriter.MethodPool.Record.ForDefinedMethod
implements ByteCodeAppender
An abstract method pool entry that delegates the implementation of a method to itself.
-
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.WithoutBodyNested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.ByteCodeAppender
ByteCodeAppender.Compound, ByteCodeAppender.Simple, ByteCodeAppender.SizeNested 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 TypeFieldDescriptionprotected final MethodDescription.InDefinedShapeThe delegation method.protected final VisibilityThe record's visibility. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDelegationRecord(MethodDescription.InDefinedShape methodDescription, Visibility visibility) Creates a new delegation record. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyAttributes(org.objectweb.asm.MethodVisitor methodVisitor, AnnotationValueFilter.Factory annotationValueFilterFactory) Applies the attributes of this entry.voidapplyBody(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, AnnotationValueFilter.Factory annotationValueFilterFactory) Applies the body of this entry.applyCode(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext) Applies the code of this entry.voidapplyHead(org.objectweb.asm.MethodVisitor methodVisitor) Applies the head of this entry.Returns the method that is implemented where the returned method resembles a potential transformation.getSort()Returns the sort of this method instrumentation.The visibility to enforce for this method.prepend(ByteCodeAppender byteCodeAppender) Prepends the given method appender to this entry.protected abstract Implementation.Context.Default.DelegationRecordwith(MethodAccessorFactory.AccessType accessType) Returns this delegation record with the minimal visibility represented by the supplied access type.Methods inherited from class net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool.Record.ForDefinedMethod
applyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.bytebuddy.implementation.bytecode.ByteCodeAppender
apply
-
Field Details
-
methodDescription
The delegation method. -
visibility
The record's visibility.
-
-
Constructor Details
-
DelegationRecord
protected DelegationRecord(MethodDescription.InDefinedShape methodDescription, Visibility visibility) Creates a new delegation record.- Parameters:
methodDescription- The delegation method.visibility- The method's actual visibility.
-
-
Method Details
-
with
protected abstract Implementation.Context.Default.DelegationRecord with(MethodAccessorFactory.AccessType accessType) Returns this delegation record with the minimal visibility represented by the supplied access type.- Parameters:
accessType- The access type to enforce.- Returns:
- A new version of this delegation record with the minimal implied visibility.
-
getMethod
Returns the method that is implemented where the returned method resembles a potential transformation. An implemented method is only defined if a method is notTypeWriter.MethodPool.Record.Sort.SKIPPED.- Specified by:
getMethodin interfaceTypeWriter.MethodPool.Record- Returns:
- The implemented method.
-
getSort
Returns the sort of this method instrumentation.- Specified by:
getSortin interfaceTypeWriter.MethodPool.Record- Returns:
- The sort of this method instrumentation.
-
getVisibility
The visibility to enforce for this method.- Specified by:
getVisibilityin interfaceTypeWriter.MethodPool.Record- Returns:
- The visibility to enforce for this method.
-
applyHead
public void applyHead(org.objectweb.asm.MethodVisitor methodVisitor) Applies the head of this entry. Applying an entry is only possible if a method is defined, i.e. the sort of this entry is notTypeWriter.MethodPool.Record.Sort.SKIPPED.- Specified by:
applyHeadin interfaceTypeWriter.MethodPool.Record- Parameters:
methodVisitor- The method visitor to which this entry should be applied.
-
applyBody
public void applyBody(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, AnnotationValueFilter.Factory annotationValueFilterFactory) Applies the body of this entry. Applying the body of an entry is only possible if a method is implemented, i.e. the sort of this entry isTypeWriter.MethodPool.Record.Sort.IMPLEMENTED.- Specified by:
applyBodyin interfaceTypeWriter.MethodPool.Record- Parameters:
methodVisitor- The method visitor to which this entry should be applied.implementationContext- The implementation context to which this entry should be applied.annotationValueFilterFactory- The annotation value filter factory to apply when writing annotations.
-
applyAttributes
public void applyAttributes(org.objectweb.asm.MethodVisitor methodVisitor, AnnotationValueFilter.Factory annotationValueFilterFactory) Applies the attributes of this entry. Applying the body of an entry is only possible if a method is implemented, i.e. the sort of this entry isTypeWriter.MethodPool.Record.Sort.DEFINED.- Specified by:
applyAttributesin interfaceTypeWriter.MethodPool.Record- Parameters:
methodVisitor- The method visitor to which this entry should be applied.annotationValueFilterFactory- The annotation value filter factory to apply when writing annotations.
-
applyCode
public ByteCodeAppender.Size applyCode(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext) Applies the code of this entry. Applying the body of an entry is only possible if a method is implemented, i.e. the sort of this entry isTypeWriter.MethodPool.Record.Sort.IMPLEMENTED.- Specified by:
applyCodein interfaceTypeWriter.MethodPool.Record- Parameters:
methodVisitor- The method visitor to which this entry should be applied.implementationContext- The implementation context to which this entry should be applied.- Returns:
- The size requirements of the implemented code.
-
prepend
Prepends the given method appender to this entry.- Specified by:
prependin interfaceTypeWriter.MethodPool.Record- Parameters:
byteCodeAppender- The byte code appender to prepend.- Returns:
- This entry with the given code prepended.
-