Class AsmVisitorWrapper.ForDeclaredFields

    • Constructor Detail

      • ForDeclaredFields

        public ForDeclaredFields()
        Creates a new visitor wrapper for declared fields.
      • ForDeclaredFields

        protected ForDeclaredFields​(java.util.List<AsmVisitorWrapper.ForDeclaredFields.Entry> entries)
        Creates a new visitor wrapper for declared fields.
        Parameters:
        entries - The list of entries that describe matched fields in their application order.
    • Method Detail

      • field

        public AsmVisitorWrapper.ForDeclaredFields field​(ElementMatcher<? super FieldDescription.InDefinedShape> matcher,
                                                         java.util.List<? extends AsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper> fieldVisitorWrappers)
        Defines a new field visitor wrapper to be applied if the given field matcher is matched. Previously defined entries are applied before the given matcher is applied.
        Parameters:
        matcher - The matcher to identify fields to be wrapped.
        fieldVisitorWrappers - The field visitor wrapper to be applied if the given matcher is matched.
        Returns:
        A new ASM visitor wrapper that applied the given field visitor wrapper if the supplied matcher is matched.
      • 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 a ClassVisitorWrapper to the creation of a DynamicType.
        Parameters:
        instrumentedType - The instrumented type.
        classVisitor - A ClassVisitor to become the new primary class visitor to which the created DynamicType is 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 ASM ClassWriter flags to consider.
        readerFlags - The ASM ClassReader flags to consider.
        Returns:
        A new ClassVisitor that usually delegates to the ClassVisitor delivered in the argument.