Class AsmVisitorWrapper.Compound
java.lang.Object
net.bytebuddy.asm.AsmVisitorWrapper.Compound
- All Implemented Interfaces:
AsmVisitorWrapper
- Enclosing interface:
AsmVisitorWrapper
An ordered, immutable chain of
AsmVisitorWrappers.-
Nested Class Summary
Nested classes/interfaces inherited from interface AsmVisitorWrapper
AsmVisitorWrapper.AbstractBase, AsmVisitorWrapper.Compound, AsmVisitorWrapper.ForDeclaredFields, AsmVisitorWrapper.ForDeclaredMethods, AsmVisitorWrapper.NoOp -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<AsmVisitorWrapper> The class visitor wrappers that are represented by this chain in their order.Fields inherited from interface AsmVisitorWrapper
NO_FLAGS -
Constructor Summary
ConstructorsConstructorDescriptionCompound(List<? extends AsmVisitorWrapper> asmVisitorWrappers) Creates a new immutable chain based on an existing list ofAsmVisitorWrappers where no copy of the received list is made.Compound(AsmVisitorWrapper... asmVisitorWrapper) Creates a new immutable chain based on an existing list ofAsmVisitorWrappers where no copy of the received array is made. -
Method Summary
Modifier and TypeMethodDescriptionintmergeReader(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 Details
-
asmVisitorWrappers
The class visitor wrappers that are represented by this chain in their order. This list must not be mutated.
-
-
Constructor Details
-
Compound
Creates a new immutable chain based on an existing list ofAsmVisitorWrappers where no copy of the received array is made.- Parameters:
asmVisitorWrapper- An array ofAsmVisitorWrappers where elements at the beginning of the list are applied first, i.e. will be at the bottom of the generatedClassVisitor.
-
Compound
Creates a new immutable chain based on an existing list ofAsmVisitorWrappers where no copy of the received list is made.- Parameters:
asmVisitorWrappers- A list ofAsmVisitorWrappers where elements at the beginning of the list are applied first, i.e. will be at the bottom of the generatedClassVisitor.
-
-
Method Details
-
mergeWriter
public 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.- Specified by:
mergeWriterin interfaceAsmVisitorWrapper- 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
public 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.- Specified by:
mergeReaderin interfaceAsmVisitorWrapper- 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
public 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.- Specified by:
wrapin interfaceAsmVisitorWrapper- 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.
-