Package net.bytebuddy.dynamic.scaffold
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 Classes Modifier and Type Class Description protected static classTypeWriter.MethodPool.Record.ForDefinedMethod.OfVisibilityBridge.VisibilityBridgeA method describing a visibility bridge.-
Nested classes/interfaces inherited from class net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool.Record.ForDefinedMethod
TypeWriter.MethodPool.Record.ForDefinedMethod.OfVisibilityBridge, TypeWriter.MethodPool.Record.ForDefinedMethod.WithAnnotationDefaultValue, TypeWriter.MethodPool.Record.ForDefinedMethod.WithBody, TypeWriter.MethodPool.Record.ForDefinedMethod.WithoutBody
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.ByteCodeAppender
ByteCodeAppender.Compound, ByteCodeAppender.Simple, ByteCodeAppender.Size
-
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 MethodAttributeAppenderattributeAppenderThe attribute appender to apply to the visibility bridge.private MethodDescriptionbridgeTargetThe method the visibility bridge invokes.private TypeDescriptionbridgeTypeThe type on which the bridge method is invoked.private MethodDescriptionvisibilityBridgeThe visibility bridge.
-
Constructor Summary
Constructors Modifier Constructor Description protectedOfVisibilityBridge(MethodDescription visibilityBridge, MethodDescription bridgeTarget, TypeDescription bridgeType, MethodAttributeAppender attributeAppender)Creates a new record for a visibility bridge.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteCodeAppender.Sizeapply(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.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.static TypeWriter.MethodPool.Recordof(TypeDescription instrumentedType, MethodDescription bridgeTarget, MethodAttributeAppender attributeAppender)Creates a record for a visibility bridge.TypeWriter.MethodPool.Recordprepend(ByteCodeAppender byteCodeAppender)Prepends the given method appender to this entry.-
Methods inherited from class net.bytebuddy.dynamic.scaffold.TypeWriter.MethodPool.Record.ForDefinedMethod
apply
-
-
-
-
Field Detail
-
visibilityBridge
private final MethodDescription visibilityBridge
The visibility bridge.
-
bridgeTarget
private final MethodDescription bridgeTarget
The method the visibility bridge invokes.
-
bridgeType
private final TypeDescription bridgeType
The type on which the bridge method is invoked.
-
attributeAppender
private final MethodAttributeAppender attributeAppender
The attribute appender to apply to the visibility bridge.
-
-
Constructor Detail
-
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 Detail
-
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
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.
-
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.
-
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.
-
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.
-
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.
-
-