Package net.bytebuddy.dynamic.scaffold
Class TypeWriter.MethodPool.Record.ForNonImplementedMethod
java.lang.Object
net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool.Record.ForNonImplementedMethod
- All Implemented Interfaces:
TypeWriter.MethodPool.Record
- Enclosing interface:
- TypeWriter.MethodPool.Record
@Enhance
public static class TypeWriter.MethodPool.Record.ForNonImplementedMethod
extends Object
implements TypeWriter.MethodPool.Record
A canonical implementation of a method that is not declared but inherited by the instrumented type.
-
Nested Class Summary
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 -
Constructor Summary
ConstructorsConstructorDescriptionForNonImplementedMethod
(MethodDescription methodDescription) Creates a new undefined record. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(org.objectweb.asm.ClassVisitor classVisitor, Implementation.Context implementationContext, AnnotationValueFilter.Factory annotationValueFilterFactory) Applies this method entry.void
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.
-
Field Details
-
methodDescription
The undefined method.
-
-
Constructor Details
-
ForNonImplementedMethod
Creates a new undefined record.- Parameters:
methodDescription
- The undefined method.
-
-
Method Details
-
apply
public void apply(org.objectweb.asm.ClassVisitor classVisitor, Implementation.Context implementationContext, AnnotationValueFilter.Factory annotationValueFilterFactory) Applies this method entry. This method can always be called and might be a no-op.- Specified by:
apply
in interfaceTypeWriter.MethodPool.Record
- Parameters:
classVisitor
- The class 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.
-
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.
-
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.
-
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.
-
getVisibility
The visibility to enforce for this method.- Specified by:
getVisibility
in interfaceTypeWriter.MethodPool.Record
- Returns:
- The visibility to enforce for this method.
-
getSort
Returns the sort of this method instrumentation.- Specified by:
getSort
in interfaceTypeWriter.MethodPool.Record
- Returns:
- The sort of this method instrumentation.
-
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.
-