/** * Returns the set of indirectly implemented interfaces. */ private Set indirectlyImplementedInterfaces(Clazz clazz) { Set set = new HashSet(); ReferencedClassVisitor referencedInterfaceCollector = new ReferencedClassVisitor( new ClassHierarchyTraveler(false, false, true, false, new ClassCollector(set))); // Visit all superclasses and collect their interfaces. clazz.superClassConstantAccept(referencedInterfaceCollector); // Visit all interfaces and collect their interfaces. clazz.interfaceConstantsAccept(referencedInterfaceCollector); return set; }
/** * Returns the set of indirectly implemented interfaces. */ private Set indirectlyImplementedInterfaces(Clazz clazz) { Set set = new HashSet(); ReferencedClassVisitor referencedInterfaceCollector = new ReferencedClassVisitor( new ClassHierarchyTraveler(false, false, true, false, new ClassCollector(set))); // Visit all superclasses and collect their interfaces. clazz.superClassConstantAccept(referencedInterfaceCollector); // Visit all interfaces and collect their interfaces. clazz.interfaceConstantsAccept(referencedInterfaceCollector); return set; }
/** * Returns the set of indirectly implemented interfaces. */ private Set indirectlyImplementedInterfaces(Clazz clazz) { Set set = new HashSet(); ReferencedClassVisitor referencedInterfaceCollector = new ReferencedClassVisitor( new ClassHierarchyTraveler(false, false, true, false, new ClassCollector(set))); // Visit all superclasses and collect their interfaces. clazz.superClassConstantAccept(referencedInterfaceCollector); // Visit all interfaces and collect their interfaces. clazz.interfaceConstantsAccept(referencedInterfaceCollector); return set; }
/** * Returns the set of indirectly implemented interfaces. */ private Set indirectlyImplementedInterfaces(Clazz clazz) { Set set = new HashSet(); ReferencedClassVisitor referencedInterfaceCollector = new ReferencedClassVisitor( new ClassHierarchyTraveler(false, false, true, false, new ClassCollector(set))); // Visit all superclasses and collect their interfaces. clazz.superClassConstantAccept(referencedInterfaceCollector); // Visit all interfaces and collect their interfaces. clazz.interfaceConstantsAccept(referencedInterfaceCollector); return set; }
/** * Constructs a ClassVisitor to efficiently travel to the specified class * members. * * @param classSpecification the specifications of the class members to visit. * @param memberVisitor the MemberVisitor to be applied to matching * class members. */ private static ClassVisitor createClassVisitor(ClassSpecification classSpecification, MemberVisitor memberVisitor) { MultiClassVisitor multiClassVisitor = new MultiClassVisitor(); addMemberVisitors(classSpecification.fieldSpecifications, true, multiClassVisitor, memberVisitor); addMemberVisitors(classSpecification.methodSpecifications, false, multiClassVisitor, memberVisitor); // Mark the class member in this class and in super classes. return new ClassHierarchyTraveler(true, true, false, false, multiClassVisitor); }
/** * Constructs a ClassVisitor to efficiently travel to the specified class * members. * * @param fieldSpecifications the specifications of the fields to visit. * @param methodSpecifications the specifications of the methods to visit. * @param fieldVisitor an optional MemberVisitor to be applied to * matching fields. * @param methodVisitor an optional MemberVisitor to be applied to * matching methods. * @param attributeVisitor an optional AttributeVisitor to be applied * to matching attributes. * @param variableStringMatchers an optional mutable list of * VariableStringMatcher instances that match * the wildcards. */ private ClassVisitor createClassVisitor(List fieldSpecifications, List methodSpecifications, MemberVisitor fieldVisitor, MemberVisitor methodVisitor, AttributeVisitor attributeVisitor, List variableStringMatchers) { MultiClassVisitor multiClassVisitor = new MultiClassVisitor(); addMemberVisitors(fieldSpecifications, true, multiClassVisitor, fieldVisitor, attributeVisitor, variableStringMatchers); addMemberVisitors(methodSpecifications, false, multiClassVisitor, methodVisitor, attributeVisitor, variableStringMatchers); // Mark the class member in this class and in super classes. return new ClassHierarchyTraveler(true, true, false, false, multiClassVisitor); }
/** * Constructs a ClassVisitor to efficiently travel to the specified class * members. * * @param fieldSpecifications the specifications of the fields to visit. * @param methodSpecifications the specifications of the methods to visit. * @param fieldVisitor an optional MemberVisitor to be applied to * matching fields. * @param methodVisitor an optional MemberVisitor to be applied to * matching methods. * @param attributeVisitor an optional AttributeVisitor to be applied * to matching attributes. * @param variableStringMatchers an optional mutable list of * VariableStringMatcher instances that match * the wildcards. */ private ClassVisitor createClassVisitor(List fieldSpecifications, List methodSpecifications, MemberVisitor fieldVisitor, MemberVisitor methodVisitor, AttributeVisitor attributeVisitor, List variableStringMatchers) { MultiClassVisitor multiClassVisitor = new MultiClassVisitor(); addMemberVisitors(fieldSpecifications, true, multiClassVisitor, fieldVisitor, attributeVisitor, variableStringMatchers); addMemberVisitors(methodSpecifications, false, multiClassVisitor, methodVisitor, attributeVisitor, variableStringMatchers); // Mark the class member in this class and in super classes. return new ClassHierarchyTraveler(true, true, false, false, multiClassVisitor); }
/** * Constructs a ClassVisitor to efficiently travel to the specified class * members. * * @param fieldSpecifications the specifications of the fields to visit. * @param methodSpecifications the specifications of the methods to visit. * @param fieldVisitor an optional MemberVisitor to be applied to * matching fields. * @param methodVisitor an optional MemberVisitor to be applied to * matching methods. * @param attributeVisitor an optional AttributeVisitor to be applied * to matching attributes. * @param variableStringMatchers an optional mutable list of * VariableStringMatcher instances that match * the wildcards. */ private ClassVisitor createClassVisitor(List fieldSpecifications, List methodSpecifications, MemberVisitor fieldVisitor, MemberVisitor methodVisitor, AttributeVisitor attributeVisitor, List variableStringMatchers) { MultiClassVisitor multiClassVisitor = new MultiClassVisitor(); addMemberVisitors(fieldSpecifications, true, multiClassVisitor, fieldVisitor, attributeVisitor, variableStringMatchers); addMemberVisitors(methodSpecifications, false, multiClassVisitor, methodVisitor, attributeVisitor, variableStringMatchers); // Mark the class member in this class and in super classes. return new ClassHierarchyTraveler(true, true, false, false, multiClassVisitor); }
/** * Marks the hierarchy of implementing or overriding methods corresponding * to the given method, if any. */ protected void markMethodHierarchy(Clazz clazz, Method method) { if ((method.getAccessFlags() & (ClassConstants.INTERNAL_ACC_PRIVATE | ClassConstants.INTERNAL_ACC_STATIC)) == 0) { clazz.accept(new ConcreteClassDownTraveler( new ClassHierarchyTraveler(true, true, false, true, new NamedMethodVisitor(method.getName(clazz), method.getDescriptor(clazz), new MemberAccessFilter(0, ClassConstants.INTERNAL_ACC_PRIVATE | ClassConstants.INTERNAL_ACC_STATIC | ClassConstants.INTERNAL_ACC_ABSTRACT, this))))); } }
new ReferencedClassVisitor( new LibraryClassFilter( new ClassHierarchyTraveler(true, true, true, false, new LibraryClassFilter( new ClassPoolFiller(reducedLibraryClassPool)))))); new ClassHierarchyTraveler(true, true, true, false, new LibraryClassFilter( new ClassPoolFiller(libraryClassPool))), new ClassHierarchyTraveler(true, true, true, false, new LibraryClassFilter( new ClassPoolFiller(libraryClassPool)))))
new ReferencedClassVisitor( new LibraryClassFilter( new ClassHierarchyTraveler(true, true, true, false, new LibraryClassFilter( new ClassPoolFiller(reducedLibraryClassPool)))))); new ClassHierarchyTraveler(true, true, true, false, new LibraryClassFilter( new ClassPoolFiller(libraryClassPool))), new ClassHierarchyTraveler(true, true, true, false, new LibraryClassFilter( new ClassPoolFiller(libraryClassPool)))))
new ReferencedClassVisitor( new LibraryClassFilter( new ClassHierarchyTraveler(true, true, true, false, new LibraryClassFilter( new ClassPoolFiller(reducedLibraryClassPool)))))); new ClassHierarchyTraveler(true, true, true, false, new LibraryClassFilter( new ClassPoolFiller(libraryClassPool))), new ClassHierarchyTraveler(true, true, true, false, new LibraryClassFilter( new ClassPoolFiller(libraryClassPool)))))
new ClassHierarchyTraveler(false, false, false, true, new ProgramClassFilter( new ClassAccessFilter(ClassConstants.ACC_INTERFACE, 0, new ClassHierarchyTraveler(true, true, false, true, new NamedMethodVisitor(method.getName(clazz), method.getDescriptor(clazz),
new ClassHierarchyTraveler(false, false, false, true, new ProgramClassFilter( new ClassAccessFilter(ClassConstants.ACC_INTERFACE, 0, new ClassHierarchyTraveler(true, true, false, true, new NamedMethodVisitor(method.getName(clazz), method.getDescriptor(clazz),
new ClassHierarchyTraveler(false, false, false, true, new ProgramClassFilter( new ClassAccessFilter(ClassConstants.ACC_INTERFACE, 0, new ClassHierarchyTraveler(true, true, false, true, new NamedMethodVisitor(method.getName(clazz), method.getDescriptor(clazz),
new ReferencedClassVisitor( new LibraryClassFilter( new ClassHierarchyTraveler(true, true, true, false, new LibraryClassFilter( new ClassPoolFiller(reducedLibraryClassPool)))))); new MultiClassVisitor(new ClassVisitor[] new ClassHierarchyTraveler(true, true, true, false, new LibraryClassFilter( new ClassPoolFiller(libraryClassPool))),
new DynamicReturnedClassVisitor( new FunctionalInterfaceFilter( new ClassHierarchyTraveler(true, false, true, false, new AllMethodVisitor( new MemberAccessFilter(ClassConstants.ACC_ABSTRACT, 0, new ClassHierarchyTraveler(true, false, false, true, new AllMemberVisitor( new MemberAccessFilter(ClassConstants.ACC_PRIVATE, 0, new ClassHierarchyTraveler(false, true, true, false, new AllMemberVisitor( new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, new ClassHierarchyTraveler(true, false, false, true, new AllMemberVisitor( new MemberAccessFilter(ClassConstants.ACC_PRIVATE, 0, new ClassHierarchyTraveler(false, true, true, false, new AllMemberVisitor( new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE,
new DynamicReturnedClassVisitor( new FunctionalInterfaceFilter( new ClassHierarchyTraveler(true, false, true, false, new AllMethodVisitor( new MemberAccessFilter(ClassConstants.ACC_ABSTRACT, 0, new ClassHierarchyTraveler(true, false, false, true, new AllMemberVisitor( new MemberAccessFilter(ClassConstants.ACC_PRIVATE, 0, new ClassHierarchyTraveler(false, true, true, false, new AllMemberVisitor( new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, new ClassHierarchyTraveler(true, false, false, true, new AllMemberVisitor( new MemberAccessFilter(ClassConstants.ACC_PRIVATE, 0, new ClassHierarchyTraveler(false, true, true, false, new AllMemberVisitor( new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE,
new ClassHierarchyTraveler(true, false, false, true, new AllMemberVisitor( new MemberAccessFilter(ClassConstants.INTERNAL_ACC_PRIVATE, 0, new ClassHierarchyTraveler(true, false, false, true, new AllMemberVisitor( new MemberAccessFilter(ClassConstants.INTERNAL_ACC_PRIVATE, 0,
new DynamicReturnedClassVisitor( new FunctionalInterfaceFilter( new ClassHierarchyTraveler(true, false, true, false, new AllMethodVisitor( new MemberAccessFilter(ClassConstants.ACC_ABSTRACT, 0, new ClassHierarchyTraveler(true, false, false, true, new AllMemberVisitor( new MemberAccessFilter(ClassConstants.ACC_PRIVATE, 0, new ClassHierarchyTraveler(false, true, true, false, new AllMemberVisitor( new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, new ClassHierarchyTraveler(true, false, false, true, new AllMemberVisitor( new MemberAccessFilter(ClassConstants.ACC_PRIVATE, 0, new ClassHierarchyTraveler(false, true, true, false, new AllMemberVisitor( new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE,