private int _getJavaClassLineNumber(JavaClass javaClass) { int lineNumber = javaClass.getLineNumber(); Annotation[] annotations = javaClass.getAnnotations(); if (annotations.length == 0) { return lineNumber; } for (Annotation annotation : annotations) { int annotationLineNumber = annotation.getLineNumber(); Map<String, String> propertyMap = annotation.getPropertyMap(); if (propertyMap.isEmpty()) { annotationLineNumber--; } if (annotationLineNumber < lineNumber) { lineNumber = annotationLineNumber; } } return lineNumber; }
public void buildAnnotationCollection() { this.annotations = new ArrayList<JavaAnnotation>(); Annotation[] annotations = javaClass.getAnnotations(); for (int i = 0; i < annotations.length; i++) { this.annotations.add(new QDoxAnnotationAdapter(annotations[i])); } }
private JavaAnnotation getPathAnnotation(JavaClass javaClass) { Optional<JavaAnnotation> optional = javaClass .getAnnotations() .stream() .filter(a -> a.getType().getName().equals(PATH)) .findAny(); return optional.isPresent() ? optional.get() : null; }