Package net.bytebuddy.dynamic.scaffold
Interface TypeWriter.MethodPool.Record
-
- All Known Implementing Classes:
Implementation.Context.Default.AccessorMethodDelegation
,Implementation.Context.Default.DelegationRecord
,Implementation.Context.Default.FieldGetterDelegation
,Implementation.Context.Default.FieldSetterDelegation
,TypeWriter.MethodPool.Record.AccessBridgeWrapper
,TypeWriter.MethodPool.Record.ForDefinedMethod
,TypeWriter.MethodPool.Record.ForDefinedMethod.OfVisibilityBridge
,TypeWriter.MethodPool.Record.ForDefinedMethod.WithAnnotationDefaultValue
,TypeWriter.MethodPool.Record.ForDefinedMethod.WithBody
,TypeWriter.MethodPool.Record.ForDefinedMethod.WithoutBody
,TypeWriter.MethodPool.Record.ForNonImplementedMethod
- Enclosing interface:
- TypeWriter.MethodPool
public static interface TypeWriter.MethodPool.Record
An entry of a method pool that describes how a method is implemented.- See Also:
TypeWriter.MethodPool
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TypeWriter.MethodPool.Record.AccessBridgeWrapper
A wrapper that appends accessor bridges for a method's implementation.static class
TypeWriter.MethodPool.Record.ForDefinedMethod
A base implementation of an abstract entry that defines a method.static class
TypeWriter.MethodPool.Record.ForNonImplementedMethod
A canonical implementation of a method that is not declared but inherited by the instrumented type.static class
TypeWriter.MethodPool.Record.Sort
The sort of an entry.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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.ByteCodeAppender.Size
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.MethodDescription
getMethod()
Returns the method that is implemented where the returned method resembles a potential transformation.TypeWriter.MethodPool.Record.Sort
getSort()
Returns the sort of this method instrumentation.Visibility
getVisibility()
The visibility to enforce for this method.TypeWriter.MethodPool.Record
prepend(ByteCodeAppender byteCodeAppender)
Prepends the given method appender to this entry.
-
-
-
Method Detail
-
getSort
TypeWriter.MethodPool.Record.Sort getSort()
Returns the sort of this method instrumentation.- Returns:
- The sort of this method instrumentation.
-
getMethod
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
.- Returns:
- The implemented method.
-
getVisibility
Visibility getVisibility()
The visibility to enforce for this method.- Returns:
- The visibility to enforce for this method.
-
prepend
TypeWriter.MethodPool.Record prepend(ByteCodeAppender byteCodeAppender)
Prepends the given method appender to this entry.- Parameters:
byteCodeAppender
- The byte code appender to prepend.- Returns:
- This entry with the given code prepended.
-
apply
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.- 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.
-
applyHead
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
.- Parameters:
methodVisitor
- The method visitor to which this entry should be applied.
-
applyBody
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
.- 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
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
.- Parameters:
methodVisitor
- The method visitor to which this entry should be applied.annotationValueFilterFactory
- The annotation value filter factory to apply when writing annotations.
-
applyCode
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
.- 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.
-
-