コード例 #1
0
  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;
  }
コード例 #2
0
  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]));
    }
  }
コード例 #3
0
ファイル: OnosSwaggerMojo.java プロジェクト: rvhub/onos
 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;
 }