/** * Match the given list of extracted variable names to argument slots. */ private void bindAnnotationsFromVarNames(List<String> varNames) { if (!varNames.isEmpty()) { // we have work to do... int numAnnotationSlots = countNumberOfUnboundAnnotationArguments(); if (numAnnotationSlots > 1) { throw new AmbiguousBindingException("Found " + varNames.size() + " potential annotation variable(s), and " + numAnnotationSlots + " potential argument slots"); } else if (numAnnotationSlots == 1) { if (varNames.size() == 1) { // it's a match findAndBind(Annotation.class, varNames.get(0)); } else { // multiple candidate vars, but only one slot throw new IllegalArgumentException("Found " + varNames.size() + " candidate annotation binding variables" + " but only one potential argument binding slot"); } } else { // no slots so presume those candidate vars were actually type names } } }
/** * Match the given list of extracted variable names to argument slots. */ private void bindAnnotationsFromVarNames(List<String> varNames) { if (!varNames.isEmpty()) { // we have work to do... int numAnnotationSlots = countNumberOfUnboundAnnotationArguments(); if (numAnnotationSlots > 1) { throw new AmbiguousBindingException("Found " + varNames.size() + " potential annotation variable(s), and " + numAnnotationSlots + " potential argument slots"); } else if (numAnnotationSlots == 1) { if (varNames.size() == 1) { // it's a match findAndBind(Annotation.class, varNames.get(0)); } else { // multiple candidate vars, but only one slot throw new IllegalArgumentException("Found " + varNames.size() + " candidate annotation binding variables" + " but only one potential argument binding slot"); } } else { // no slots so presume those candidate vars were actually type names } } }
/** * Match the given list of extracted variable names to argument slots. */ private void bindAnnotationsFromVarNames(List<String> varNames) { if (!varNames.isEmpty()) { // we have work to do... int numAnnotationSlots = countNumberOfUnboundAnnotationArguments(); if (numAnnotationSlots > 1) { throw new AmbiguousBindingException("Found " + varNames.size() + " potential annotation variable(s), and " + numAnnotationSlots + " potential argument slots"); } else if (numAnnotationSlots == 1) { if (varNames.size() == 1) { // it's a match findAndBind(Annotation.class, varNames.get(0)); } else { // multiple candidate vars, but only one slot throw new IllegalArgumentException("Found " + varNames.size() + " candidate annotation binding variables" + " but only one potential argument binding slot"); } } else { // no slots so presume those candidate vars were actually type names } } }