Class TypeWriter.MethodPool.Record.ForDefinedMethod.OfVisibilityBridge
java.lang.Object
net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool.Record.ForDefinedMethod
net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool.Record.ForDefinedMethod.OfVisibilityBridge
- All Implemented Interfaces:
TypeWriter.MethodPool.Record, ByteCodeAppender
- Enclosing class:
TypeWriter.MethodPool.Record.ForDefinedMethod
@Enhance
public static class TypeWriter.MethodPool.Record.ForDefinedMethod.OfVisibilityBridge
extends TypeWriter.MethodPool.Record.ForDefinedMethod
implements ByteCodeAppender
A record for a visibility bridge.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA method describing a visibility bridge.Nested classes/interfaces inherited from class TypeWriter.MethodPool.Record.ForDefinedMethod
TypeWriter.MethodPool.Record.ForDefinedMethod.OfVisibilityBridge, TypeWriter.MethodPool.Record.ForDefinedMethod.WithAnnotationDefaultValue, TypeWriter.MethodPool.Record.ForDefinedMethod.WithBody, TypeWriter.MethodPool.Record.ForDefinedMethod.WithoutBodyNested classes/interfaces inherited from interface ByteCodeAppender
ByteCodeAppender.Compound, ByteCodeAppender.Simple, ByteCodeAppender.SizeNested classes/interfaces inherited from interface TypeWriter.MethodPool.Record
TypeWriter.MethodPool.Record.AccessBridgeWrapper, TypeWriter.MethodPool.Record.ForDefinedMethod, TypeWriter.MethodPool.Record.ForNonImplementedMethod, TypeWriter.MethodPool.Record.Sort -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOfVisibilityBridge(MethodDescription visibilityBridge, MethodDescription bridgeTarget, TypeDescription bridgeType, MethodAttributeAppender attributeAppender) Creates a new record for a visibility bridge. -
Method Summary
Modifier and TypeMethodDescriptionapply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod) Applies this byte code appender to a type creation process.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.applyCode(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.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.static TypeWriter.MethodPool.Recordof(TypeDescription instrumentedType, MethodDescription bridgeTarget, MethodAttributeAppender attributeAppender) Creates a record for a visibility bridge.prepend(ByteCodeAppender byteCodeAppender) Prepends the given method appender to this entry.Methods inherited from class TypeWriter.MethodPool.Record.ForDefinedMethod
apply
-
Constructor Details
-
OfVisibilityBridge
protected OfVisibilityBridge(MethodDescription visibilityBridge, MethodDescription bridgeTarget, TypeDescription bridgeType, MethodAttributeAppender attributeAppender) Creates a new record for a visibility bridge.- Parameters:
visibilityBridge- The visibility bridge.bridgeTarget- The method the visibility bridge invokes.bridgeType- The type of the instrumented type.attributeAppender- The attribute appender to apply to the visibility bridge.
-
-
Method Details
-
of
public static TypeWriter.MethodPool.Record of(TypeDescription instrumentedType, MethodDescription bridgeTarget, MethodAttributeAppender attributeAppender) Creates a record for a visibility bridge.- Parameters:
instrumentedType- The instrumented type.bridgeTarget- The target method of the visibility bridge.attributeAppender- The attribute appender to apply to the visibility bridge.- Returns:
- A record describing the visibility bridge.
-
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
Returns the sort of this method instrumentation.- Specified by:
getSortin interfaceTypeWriter.MethodPool.Record- Returns:
- The sort of this method instrumentation.
-
getVisibility
The visibility to enforce for this method.- Specified by:
getVisibilityin interfaceTypeWriter.MethodPool.Record- Returns:
- The visibility to enforce for this method.
-
prepend
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.
-
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.
-
apply
public ByteCodeAppender.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod) Applies this byte code appender to a type creation process.- Specified by:
applyin interfaceByteCodeAppender- Parameters:
methodVisitor- The method visitor to which the byte code appender writes its code to.implementationContext- The implementation context of the current type creation process.instrumentedMethod- The method that is the target of the instrumentation.- Returns:
- The required size for the applied byte code to run.
-