Class ClassLoaderHierarchyMatcher<T extends ClassLoader>

java.lang.Object
net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<T>
net.bytebuddy.matcher.ClassLoaderHierarchyMatcher<T>
Type Parameters:
T - The exact type of the class loader that is matched.
All Implemented Interfaces:
ElementMatcher<T>, ElementMatcher.Junction<T>

@Enhance public class ClassLoaderHierarchyMatcher<T extends ClassLoader> extends ElementMatcher.Junction.AbstractBase<T>
An element matcher that matches all ClassLoaders in the matched class loaders hierarchy against a given matcher.
  • Field Details

    • matcher

      private final ElementMatcher<? super ClassLoader> matcher
      The matcher to apply on each class loader in the hierarchy.
  • Constructor Details

    • ClassLoaderHierarchyMatcher

      public ClassLoaderHierarchyMatcher(ElementMatcher<? super ClassLoader> matcher)
      Creates a new class loader hierarchy matcher.
      Parameters:
      matcher - The matcher to apply on each class loader in the hierarchy.
  • Method Details

    • matches

      public boolean matches(@MaybeNull T target)
      Matches a target against this element matcher.
      Parameters:
      target - The instance to be matched or null.
      Returns:
      true if the given element is matched by this matcher or false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object