public static Annotation getAnnotation(String annotationName, List<Annotation> annotationList) { Annotation annotation = null; for (Annotation aAnnotation : annotationList) { if (annotationName.equalsIgnoreCase(aAnnotation.getName())) { if (annotation == null) { annotation = aAnnotation; } else { throw new DuplicateAnnotationException("Annotation @" + annotationName + " is defined twice", aAnnotation.getQueryContextStartIndex(), aAnnotation.getQueryContextEndIndex()); } } } return annotation; }
element = aElement; } else { throw new DuplicateAnnotationException("Annotation element @" + annotationName + "(...) " + "is defined twice", aElement.getQueryContextStartIndex(), aElement.getQueryContextEndIndex()); element = aElement; } else { throw new DuplicateAnnotationException("Annotation element @" + annotationName + "(" + elementName + "=...) is defined twice", aElement.getQueryContextStartIndex(), aElement.getQueryContextEndIndex());
public static Annotation getAnnotation(String annotationName, List<Annotation> annotationList) { Annotation annotation = null; for (Annotation aAnnotation : annotationList) { if (annotationName.equalsIgnoreCase(aAnnotation.getName())) { if (annotation == null) { annotation = aAnnotation; } else { throw new DuplicateAnnotationException("Annotation @" + annotationName + " is defined twice", aAnnotation.getQueryContextStartIndex(), aAnnotation.getQueryContextEndIndex()); } } } return annotation; }
element = aElement; } else { throw new DuplicateAnnotationException("Annotation element @" + annotationName + "(...) " + "is defined twice", aElement.getQueryContextStartIndex(), aElement.getQueryContextEndIndex()); element = aElement; } else { throw new DuplicateAnnotationException("Annotation element @" + annotationName + "(" + elementName + "=...) is defined twice", aElement.getQueryContextStartIndex(), aElement.getQueryContextEndIndex());