Examples of AnnotationExpr


Examples of japa.parser.ast.expr.AnnotationExpr

        jj_consume_token(GT);
    }

/* Annotation syntax follows. */
    final public AnnotationExpr Annotation() throws ParseException {
        AnnotationExpr ret;
        if (jj_2_40(2147483647)) {
            ret = NormalAnnotation();
        } else if (jj_2_41(2147483647)) {
            ret = SingleMemberAnnotation();
        } else {
View Full Code Here

Examples of japa.parser.ast.expr.AnnotationExpr

      if (decl instanceof MethodDeclaration) {
        index = (MethodDeclaration)decl;
      }
    }
    Parameter param = index.getParameters().get(0);
    AnnotationExpr annotation = param.getAnnotations().get(0);
    param.getAnnotations().clear();
    file.assertSave();
//      helper.assertRemove("metamodel", "param", "A.java");

    // Recompile
View Full Code Here

Examples of japa.parser.ast.expr.AnnotationExpr

   * @throws IOException
   */
  public static AnnotationExpr parseAnnotation(final String annotation)
      throws ParseException {
    StringReader sr = new StringReader(annotation);
    AnnotationExpr ae = new ASTParser(sr).Annotation();
    sr.close();
    return ae;
  }
View Full Code Here

Examples of japa.parser.ast.expr.AnnotationExpr

            annotations.addAll(((AnnotableNode) node).getAnnotations());
            if (annotations.size()==0){
                return null;
            }
            sortByBeginPosition(annotations);
            AnnotationExpr lastAnnotation = annotations.get(annotations.size()-1);
            return lastAnnotation;
        } else {
            return null;
        }
    }
View Full Code Here

Examples of japa.parser.ast.expr.AnnotationExpr

        CompilationUnit compilationUnit = (CompilationUnit) state.get("cu1");

        TypeDeclaration classUnderTest = compilationUnit.getTypes().get(classPosition - 1);
        FieldDeclaration fieldUnderTest = (FieldDeclaration) getMemberByTypeAndPosition(classUnderTest, fieldPosition - 1,
                FieldDeclaration.class);
        AnnotationExpr annotationUnderTest = fieldUnderTest.getAnnotations().get(annotationPosition - 1);
        assertThat(annotationUnderTest.getChildrenNodes().get(1).toString(), is(expectedValue));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.