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
Fields Modifier and Type Field Description protected MethodDescription.InDefinedShapemethodDescriptionThe delegation method.protected VisibilityvisibilityThe record's visibility.
-
Constructor Summary
Constructors Modifier Constructor Description protectedDelegationRecord(MethodDescription.InDefinedShape methodDescription, Visibility visibility)Creates a new delegation record.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidapplyAttributes(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.ByteCodeAppender.SizeapplyCode(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.MethodDescription.InDefinedShapegetMethod()Returns the method that is implemented where the returned method resembles a potential transformation.TypeWriter.MethodPool.Record.SortgetSort()Returns the sort of this method instrumentation.VisibilitygetVisibility()The visibility to enforce for this method.TypeWriter.MethodPool.Recordprepend(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
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 Detail
-
methodDescription
protected final MethodDescription.InDefinedShape methodDescription
The delegation method.
-
visibility
protected final Visibility visibility
The record's visibility.
-
-
Constructor Detail
-
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 Detail
-
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
public MethodDescription.InDefinedShape 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
public TypeWriter.MethodPool.Record.Sort getSort()
Returns the sort of this method instrumentation.- Specified by:
getSortin interfaceTypeWriter.MethodPool.Record- Returns:
- The sort of this method instrumentation.
-
getVisibility
public Visibility 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
public TypeWriter.MethodPool.Record prepend(ByteCodeAppender byteCodeAppender)
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.
-
-