Package net.bytebuddy.asm
Interface AsmVisitorWrapper
-
- All Known Implementing Classes:
AnnotationRemoval,AsmVisitorWrapper.AbstractBase,AsmVisitorWrapper.Compound,AsmVisitorWrapper.ForDeclaredFields,AsmVisitorWrapper.ForDeclaredMethods,AsmVisitorWrapper.NoOp,MemberRemoval,ModifierAdjustment,RenamingPlugin,TypeConstantAdjustment,TypeReferenceAdjustment
public interface AsmVisitorWrapperA class visitor wrapper is used in order to register an intermediate ASMClassVisitorwhich is applied to the main type created by aDynamicType.Builderbut not to anyAuxiliaryTypes, if any.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAsmVisitorWrapper.AbstractBaseAn abstract base implementation of an ASM visitor wrapper that does not set any flags.static classAsmVisitorWrapper.CompoundAn ordered, immutable chain ofAsmVisitorWrappers.static classAsmVisitorWrapper.ForDeclaredFieldsAn ASM visitor wrapper that allows to wrap declared fields of the instrumented type with aAsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper.static classAsmVisitorWrapper.ForDeclaredMethodsAn ASM visitor wrapper that allows to wrap declared methods of the instrumented type with aAsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper.static classAsmVisitorWrapper.NoOpA class visitor wrapper that does not apply any changes.
-
Field Summary
Fields Modifier and Type Field Description static intNO_FLAGSIndicates that no flags should be set.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intmergeReader(int flags)Defines the flags that are provided to anyClassReaderwhen reading a class if applicable.intmergeWriter(int flags)Defines the flags that are provided to anyClassWriterwhen writing a class.org.objectweb.asm.ClassVisitorwrap(TypeDescription instrumentedType, org.objectweb.asm.ClassVisitor classVisitor, Implementation.Context implementationContext, TypePool typePool, FieldList<FieldDescription.InDefinedShape> fields, MethodList<?> methods, int writerFlags, int readerFlags)Applies aClassVisitorWrapperto the creation of aDynamicType.
-
-
-
Field Detail
-
NO_FLAGS
static final int NO_FLAGS
Indicates that no flags should be set.- See Also:
- Constant Field Values
-
-
Method Detail
-
mergeWriter
int mergeWriter(int flags)
Defines the flags that are provided to anyClassWriterwhen writing a class. Typically, this gives opportunity to instruct ASM to compute stack map frames or the size of the local variables array and the operand stack. If no specific flags are required for applying this wrapper, the given value is to be returned.- Parameters:
flags- The currently set flags. This value should be combined (e.g.flags | foo) into the value that is returned by this wrapper.- Returns:
- The flags to be provided to the ASM
ClassWriter.
-
mergeReader
int mergeReader(int flags)
Defines the flags that are provided to anyClassReaderwhen reading a class if applicable. Typically, this gives opportunity to instruct ASM to expand or skip frames and to skip code and debug information. If no specific flags are required for applying this wrapper, the given value is to be returned.- Parameters:
flags- The currently set flags. This value should be combined (e.g.flags | foo) into the value that is returned by this wrapper.- Returns:
- The flags to be provided to the ASM
ClassReader.
-
wrap
org.objectweb.asm.ClassVisitor wrap(TypeDescription instrumentedType, org.objectweb.asm.ClassVisitor classVisitor, Implementation.Context implementationContext, TypePool typePool, FieldList<FieldDescription.InDefinedShape> fields, MethodList<?> methods, int writerFlags, int readerFlags)
Applies aClassVisitorWrapperto the creation of aDynamicType.- Parameters:
instrumentedType- The instrumented type.classVisitor- AClassVisitorto become the new primary class visitor to which the createdDynamicTypeis written to.implementationContext- The implementation context of the current instrumentation.typePool- The type pool that was provided for the class creation.fields- The instrumented type's fields.methods- The instrumented type's methods non-ignored declared and virtually inherited methods.writerFlags- The ASMClassWriterflags to consider.readerFlags- The ASMClassReaderflags to consider.- Returns:
- A new
ClassVisitorthat usually delegates to theClassVisitordelivered in the argument.
-
-