Class AsmVisitorWrapper.ForDeclaredFields

java.lang.Object
net.bytebuddy.asm.AsmVisitorWrapper.AbstractBase
net.bytebuddy.asm.AsmVisitorWrapper.ForDeclaredFields
All Implemented Interfaces:
AsmVisitorWrapper
Enclosing interface:
AsmVisitorWrapper

@Enhance public static class AsmVisitorWrapper.ForDeclaredFields extends AsmVisitorWrapper.AbstractBase
An ASM visitor wrapper that allows to wrap declared fields of the instrumented type with a AsmVisitorWrapper.ForDeclaredFields.FieldVisitorWrapper.
  • Field Details

  • Constructor Details

    • ForDeclaredFields

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

      protected ForDeclaredFields(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 Details

    • field

      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.
      fieldVisitorWrapper - 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.
    • field

      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.