Class ImplementedClassFilter

  • All Implemented Interfaces:
    ClassVisitor

    public class ImplementedClassFilter
    extends java.lang.Object
    implements ClassVisitor
    This ClassVisitor delegates its visits to one of two given ClassVisitors, depending on whether the visited classes extend/implement a given class or not.

    Filter: - accepted: the visited class extends/implements the given class. - rejected: the visited class does not extend/implement the given class.

    • Constructor Detail

      • ImplementedClassFilter

        public ImplementedClassFilter​(Clazz implementedClass,
                                      boolean includeImplementedClass,
                                      ClassVisitor acceptedClassVisitor,
                                      ClassVisitor rejectedClassVisistor)
        Creates a new ImplementedClassFilter.
        Parameters:
        implementedClass - the class whose implementations will be accepted.
        includeImplementedClass - if true, the implemented class itself will also be accepted, otherwise it will be rejected.
        acceptedClassVisitor - the ClassVisitor to which visits of classes implementing the given class will be delegated.
        rejectedClassVisistor - the ClassVisitor to which visits of classes not implementing the given class 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