Class ClassPresenceFilter

  • All Implemented Interfaces:
    ClassVisitor

    public class ClassPresenceFilter
    extends java.lang.Object
    implements ClassVisitor
    This ClassVisitor delegates its visits to one of two ClassVisitor instances, depending on whether the name of the visited class file is present in a given ClassPool or not.
    • Constructor Detail

      • ClassPresenceFilter

        public ClassPresenceFilter​(ClassPool classPool,
                                   ClassVisitor presentClassVisitor,
                                   ClassVisitor missingClassVisitor)
        Creates a new ClassPresenceFilter.
        Parameters:
        classPool - the ClassPool in which the presence will be tested.
        presentClassVisitor - the ClassVisitor to which visits of present class files will be delegated.
        missingClassVisitor - the ClassVisitor to which visits of missing class files will be delegated.
      • ClassPresenceFilter

        public ClassPresenceFilter​(ClassPool classPool,
                                   ClassVisitor presentClassVisitor)
        Creates a new ClassPresenceFilter.
        Parameters:
        classPool - the ClassPool in which the presence will be tested.
        presentClassVisitor - the ClassVisitor to which visits of present class files 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