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.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 TypeFieldDescriptionprotected final MethodDescription.InDefinedShape
The delegation method.protected final Visibility
The record's visibility. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DelegationRecord
(MethodDescription.InDefinedShape methodDescription, Visibility visibility) Creates a new delegation record. -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyAttributes
(org.objectweb.asm.MethodVisitor methodVisitor, AnnotationValueFilter.Factory annotationValueFilterFactory) Applies the attributes of this entry.void
applyBody
(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.void
applyHead
(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.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.dynamic.scaffold.TypeWriter.MethodPool.Record.ForDefinedMethod
apply
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getMethod
in interfaceTypeWriter.MethodPool.Record
- Returns:
- The implemented method.
-
getSort
Returns the sort of this method instrumentation.- Specified by:
getSort
in interfaceTypeWriter.MethodPool.Record
- Returns:
- The sort of this method instrumentation.
-
getVisibility
The visibility to enforce for this method.- Specified by:
getVisibility
in 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:
applyHead
in 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:
applyBody
in 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:
applyAttributes
in 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:
applyCode
in 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:
prepend
in interfaceTypeWriter.MethodPool.Record
- Parameters:
byteCodeAppender
- The byte code appender to prepend.- Returns:
- This entry with the given code prepended.
-