Class ClassNameFilter

  • All Implemented Interfaces:
    ClassVisitor

    public class ClassNameFilter
    extends java.lang.Object
    implements ClassVisitor
    This ClassVisitor delegates its visits to another given ClassVisitor, but only when the visited class has a name that matches a given regular expression.
    • Constructor Detail

      • ClassNameFilter

        public ClassNameFilter​(java.lang.String regularExpression,
                               ClassVisitor acceptedClassVisitor)
        Creates a new ClassNameFilter.
        Parameters:
        regularExpression - the regular expression against which class names will be matched.
        acceptedClassVisitor - the ClassVisitor to which accepted visits will be delegated.
      • ClassNameFilter

        public ClassNameFilter​(java.lang.String regularExpression,
                               WildcardManager wildcardManager,
                               ClassVisitor acceptedClassVisitor)
        Creates a new ClassNameFilter.
        Parameters:
        regularExpression - the regular expression against which class names will be matched.
        wildcardManager - an optional scope for StringMatcher instances that match wildcards.
        acceptedClassVisitor - the ClassVisitor to which accepted visits will be delegated.
      • ClassNameFilter

        public ClassNameFilter​(java.util.List regularExpression,
                               ClassVisitor acceptedClassVisitor)
        Creates a new ClassNameFilter.
        Parameters:
        regularExpression - the regular expression against which class names will be matched.
        acceptedClassVisitor - the ClassVisitor to which accepted visits will be delegated.
      • ClassNameFilter

        public ClassNameFilter​(java.util.List regularExpression,
                               WildcardManager wildcardManager,
                               ClassVisitor acceptedClassVisitor)
        Creates a new ClassNameFilter.
        Parameters:
        regularExpression - the regular expression against which class names will be matched.
        wildcardManager - an optional scope for StringMatcher instances that match wildcards.
        acceptedClassVisitor - the ClassVisitor to which accepted visits will be delegated.
      • ClassNameFilter

        public ClassNameFilter​(StringMatcher regularExpressionMatcher,
                               ClassVisitor acceptedClassVisitor)
        Creates a new ClassNameFilter.
        Parameters:
        regularExpressionMatcher - the string matcher against which class names will be matched.
        acceptedClassVisitor - the ClassVisitor to which accepted visits will be delegated.
      • ClassNameFilter

        public ClassNameFilter​(java.lang.String regularExpression,
                               ClassVisitor acceptedClassVisitor,
                               ClassVisitor rejectedClassVisitor)
        Creates a new ClassNameFilter.
        Parameters:
        regularExpression - the regular expression against which class names will be matched.
        acceptedClassVisitor - the ClassVisitor to which accepted visits will be delegated.
        rejectedClassVisitor - the ClassVisitor to which rejected visits will be delegated.
      • ClassNameFilter

        public ClassNameFilter​(java.lang.String regularExpression,
                               WildcardManager wildcardManager,
                               ClassVisitor acceptedClassVisitor,
                               ClassVisitor rejectedClassVisitor)
        Creates a new ClassNameFilter.
        Parameters:
        regularExpression - the regular expression against which class names will be matched.
        wildcardManager - an optional scope for StringMatcher instances that match wildcards.
        acceptedClassVisitor - the ClassVisitor to which accepted visits will be delegated.
        rejectedClassVisitor - the ClassVisitor to which rejected visits will be delegated.
      • ClassNameFilter

        public ClassNameFilter​(java.util.List regularExpression,
                               ClassVisitor acceptedClassVisitor,
                               ClassVisitor rejectedClassVisitor)
        Creates a new ClassNameFilter.
        Parameters:
        regularExpression - the regular expression against which class names will be matched.
        acceptedClassVisitor - the ClassVisitor to which accepted visits will be delegated.
        rejectedClassVisitor - the ClassVisitor to which rejected visits will be delegated.
      • ClassNameFilter

        public ClassNameFilter​(java.util.List regularExpression,
                               WildcardManager wildcardManager,
                               ClassVisitor acceptedClassVisitor,
                               ClassVisitor rejectedClassVisitor)
        Creates a new ClassNameFilter.
        Parameters:
        regularExpression - the regular expression against which class names will be matched.
        wildcardManager - an optional scope for StringMatcher instances that match wildcards.
        acceptedClassVisitor - the ClassVisitor to which accepted visits will be delegated.
        rejectedClassVisitor - the ClassVisitor to which rejected visits will be delegated.
      • ClassNameFilter

        public ClassNameFilter​(StringMatcher regularExpressionMatcher,
                               ClassVisitor acceptedClassVisitor,
                               ClassVisitor rejectedClassVisitor)
        Creates a new ClassNameFilter.
        Parameters:
        regularExpressionMatcher - the string matcher against which class names will be matched.
        acceptedClassVisitor - the ClassVisitor to which accepted visits will be delegated.
        rejectedClassVisitor - the ClassVisitor to which rejected visits will be delegated.
    • Method Detail

      • visitAnyClass

        public void visitAnyClass​(Clazz clazz)
        Description copied from interface: ClassVisitor
        Visits any Clazz instance. The more specific default implementations of this interface delegate to this method.
        Specified by:
        visitAnyClass in interface ClassVisitor