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 java.lang.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 Modifier and Type Field Description private MethodDescriptionmethodDescriptionThe undefined method.
-
Constructor Summary
Constructors Constructor Description ForNonImplementedMethod(MethodDescription methodDescription)Creates a new undefined record.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(org.objectweb.asm.ClassVisitor classVisitor, Implementation.Context implementationContext, AnnotationValueFilter.Factory annotationValueFilterFactory)Applies this method entry.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.MethodDescriptiongetMethod()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.
-
-
-
Field Detail
-
methodDescription
private final MethodDescription methodDescription
The undefined method.
-
-
Constructor Detail
-
ForNonImplementedMethod
public ForNonImplementedMethod(MethodDescription methodDescription)
Creates a new undefined record.- Parameters:
methodDescription- The undefined method.
-
-
Method Detail
-
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:
applyin 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:
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.
-
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.
-
getMethod
public MethodDescription 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.
-
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.
-
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.
-
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.
-
-