Class AgentBuilder.Default.Transformation.SimpleMatcher

java.lang.Object
net.bytebuddy.agent.builder.AgentBuilder.Default.Transformation.SimpleMatcher
All Implemented Interfaces:
AgentBuilder.RawMatcher
Enclosing class:
AgentBuilder.Default.Transformation

@Enhance protected static class AgentBuilder.Default.Transformation.SimpleMatcher extends Object implements AgentBuilder.RawMatcher
A matcher that matches any type that is touched by a transformer without being ignored.
  • Field Details

  • Constructor Details

    • SimpleMatcher

      protected SimpleMatcher(AgentBuilder.RawMatcher ignoreMatcher, List<AgentBuilder.Default.Transformation> transformations)
      Creates a new simple matcher.
      Parameters:
      ignoreMatcher - Identifies types that should not be instrumented.
      transformations - The transformations to apply on non-ignored types.
  • Method Details

    • matches

      public boolean matches(TypeDescription typeDescription, @MaybeNull ClassLoader classLoader, @MaybeNull JavaModule module, @MaybeNull Class<?> classBeingRedefined, @MaybeNull ProtectionDomain protectionDomain)
      Decides if the given typeDescription should be instrumented with the entailed AgentBuilder.Transformers.
      Specified by:
      matches in interface AgentBuilder.RawMatcher
      Parameters:
      typeDescription - A description of the type to be instrumented.
      classLoader - The class loader of the instrumented type. Might be null if this class loader represents the bootstrap class loader.
      module - The transformed type's module or null if the current VM does not support modules.
      classBeingRedefined - The class being redefined which is only not null if a retransformation is applied.
      protectionDomain - The protection domain of the type being transformed or null if none is available.
      Returns:
      true if the entailed AgentBuilder.Transformers should be applied for the given typeDescription.