@HashCodeAndEqualsPlugin.Enhance public static class TypeWriter.MethodPool.Record.AccessBridgeWrapper extends java.lang.Object implements TypeWriter.MethodPool.Record
TypeWriter.MethodPool.Record.apply(ClassVisitor, Implementation.Context, AnnotationValueFilter.Factory)
is invoked such that bridges are not appended for methods that are rebased or redefined as such types already have bridge methods in place.Modifier and Type | Class and Description |
---|---|
protected static class |
TypeWriter.MethodPool.Record.AccessBridgeWrapper.AccessorBridge
A method representing an accessor bridge method.
|
protected static class |
TypeWriter.MethodPool.Record.AccessBridgeWrapper.BridgeTarget
A method representing a bridge's target method in its defined shape.
|
TypeWriter.MethodPool.Record.AccessBridgeWrapper, TypeWriter.MethodPool.Record.ForDefinedMethod, TypeWriter.MethodPool.Record.ForNonImplementedMethod, TypeWriter.MethodPool.Record.Sort
Modifier and Type | Field and Description |
---|---|
private MethodAttributeAppender |
attributeAppender
The attribute appender being applied for the bridge target.
|
private MethodDescription |
bridgeTarget
The target of the bridge method.
|
private java.util.Set<MethodDescription.TypeToken> |
bridgeTypes
A collection of all tokens representing all bridge methods.
|
private TypeWriter.MethodPool.Record |
delegate
The delegate for implementing the bridge's target.
|
private TypeDescription |
instrumentedType
The instrumented type that defines the bridge methods and the bridge target.
|
Modifier | Constructor and Description |
---|---|
protected |
AccessBridgeWrapper(TypeWriter.MethodPool.Record delegate,
TypeDescription instrumentedType,
MethodDescription bridgeTarget,
java.util.Set<MethodDescription.TypeToken> bridgeTypes,
MethodAttributeAppender attributeAppender)
Creates a wrapper for adding accessor bridges.
|
Modifier and Type | Method and 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.
|
static TypeWriter.MethodPool.Record |
of(TypeWriter.MethodPool.Record delegate,
TypeDescription instrumentedType,
MethodDescription bridgeTarget,
java.util.Set<MethodDescription.TypeToken> bridgeTypes,
MethodAttributeAppender attributeAppender)
Wraps the given record in an accessor bridge wrapper if necessary.
|
TypeWriter.MethodPool.Record |
prepend(ByteCodeAppender byteCodeAppender)
Prepends the given method appender to this entry.
|
private final TypeWriter.MethodPool.Record delegate
private final TypeDescription instrumentedType
private final MethodDescription bridgeTarget
private final java.util.Set<MethodDescription.TypeToken> bridgeTypes
private final MethodAttributeAppender attributeAppender
protected AccessBridgeWrapper(TypeWriter.MethodPool.Record delegate, TypeDescription instrumentedType, MethodDescription bridgeTarget, java.util.Set<MethodDescription.TypeToken> bridgeTypes, MethodAttributeAppender attributeAppender)
delegate
- The delegate for implementing the bridge's target.instrumentedType
- The instrumented type that defines the bridge methods and the bridge target.bridgeTarget
- The target of the bridge method.bridgeTypes
- A collection of all tokens representing all bridge methods.attributeAppender
- The attribute appender being applied for the bridge target.public static TypeWriter.MethodPool.Record of(TypeWriter.MethodPool.Record delegate, TypeDescription instrumentedType, MethodDescription bridgeTarget, java.util.Set<MethodDescription.TypeToken> bridgeTypes, MethodAttributeAppender attributeAppender)
delegate
- The delegate for implementing the bridge's target.instrumentedType
- The instrumented type that defines the bridge methods and the bridge target.bridgeTarget
- The bridge methods' target methods.bridgeTypes
- A collection of all tokens representing all bridge methods.attributeAppender
- The attribute appender being applied for the bridge target.public TypeWriter.MethodPool.Record.Sort getSort()
getSort
in interface TypeWriter.MethodPool.Record
public MethodDescription getMethod()
TypeWriter.MethodPool.Record.Sort.SKIPPED
.getMethod
in interface TypeWriter.MethodPool.Record
public Visibility getVisibility()
getVisibility
in interface TypeWriter.MethodPool.Record
public TypeWriter.MethodPool.Record prepend(ByteCodeAppender byteCodeAppender)
prepend
in interface TypeWriter.MethodPool.Record
byteCodeAppender
- The byte code appender to prepend.public void apply(org.objectweb.asm.ClassVisitor classVisitor, Implementation.Context implementationContext, AnnotationValueFilter.Factory annotationValueFilterFactory)
apply
in interface TypeWriter.MethodPool.Record
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.public void applyHead(org.objectweb.asm.MethodVisitor methodVisitor)
TypeWriter.MethodPool.Record.Sort.SKIPPED
.applyHead
in interface TypeWriter.MethodPool.Record
methodVisitor
- The method visitor to which this entry should be applied.public void applyBody(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, AnnotationValueFilter.Factory annotationValueFilterFactory)
TypeWriter.MethodPool.Record.Sort.IMPLEMENTED
.applyBody
in interface TypeWriter.MethodPool.Record
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.public void applyAttributes(org.objectweb.asm.MethodVisitor methodVisitor, AnnotationValueFilter.Factory annotationValueFilterFactory)
TypeWriter.MethodPool.Record.Sort.DEFINED
.applyAttributes
in interface TypeWriter.MethodPool.Record
methodVisitor
- The method visitor to which this entry should be applied.annotationValueFilterFactory
- The annotation value filter factory to apply when writing annotations.public ByteCodeAppender.Size applyCode(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)
TypeWriter.MethodPool.Record.Sort.IMPLEMENTED
.applyCode
in interface TypeWriter.MethodPool.Record
methodVisitor
- The method visitor to which this entry should be applied.implementationContext
- The implementation context to which this entry should be applied.