@Override public void visitClassContext(ClassContext classContext) { ConstantPoolGen cpg = classContext.getConstantPoolGen(); List<InjectionSource> selectedSources = new ArrayList<InjectionSource>(); for (InjectionSource source : getInjectionSource()) { if (source.isCandidate(cpg)) { selectedSources.add(source); } } if (selectedSources.isEmpty()) { // return; // analysis still must be requested } for (Method method : classContext.getMethodsInCallOrder()) { MethodGen methodGen = classContext.getMethodGen(method); if (methodGen == null) { continue; } try { analyzeMethod(classContext, method, selectedSources); } catch (CheckedAnalysisException e) { logException(classContext, method, e); } catch (RuntimeException e) { logException(classContext, method, e); } } }
private static InjectionPoint getInjectionPoint( InvokeInstruction invoke, ConstantPoolGen cpg, InstructionHandle handle, Collection<InjectionSource> sources) { InjectionPoint injectionPoint = null; for (InjectionSource source : sources) { injectionPoint = source.getInjectableParameters(invoke, cpg, handle); if (injectionPoint != InjectionPoint.NONE) { break; } } if (injectionPoint == null) { injectionPoint = InjectionPoint.NONE; } return injectionPoint; }