Examples of newMemberValuePair()


Examples of org.eclipse.jdt.core.dom.AST.newMemberValuePair()

  @SuppressWarnings("unchecked")
  public static void addLiteralMemberValuePair(NormalAnnotation annotation, String name, String value) {
    AST ast = annotation.getAST();
   
    List list = (List) annotation.getStructuralProperty(NormalAnnotation.VALUES_PROPERTY);
    MemberValuePair newValuePair = ast.newMemberValuePair();
    newValuePair.setName(ast.newSimpleName(name));
    newValuePair.setValue(ASTTools.newStringLiteral(ast, value));
    list.add(newValuePair);
  }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newMemberValuePair()

    // add required=false to annotation
    else {
      NormalAnnotation newAnnotation = ast.newNormalAnnotation();
      newAnnotation.setTypeName(ast.newSimpleName(annotation.getTypeName().getFullyQualifiedName()));

      MemberValuePair requiredValue = ast.newMemberValuePair();
      requiredValue.setName(ast.newSimpleName("required"));
      requiredValue.setValue(ast.newBooleanLiteral(false));
      newAnnotation.values().add(requiredValue);

      astRewrite.replace(annotation, newAnnotation, null);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newMemberValuePair()

          edit.addChild(importEdit);
        }

        ListRewrite listRewrite = astRewrite.getListRewrite(annotation, NormalAnnotation.VALUES_PROPERTY);
        AST annotationAST = annotation.getAST();
        MemberValuePair pair = annotationAST.newMemberValuePair();
        pair.setName(annotationAST.newSimpleName("method"));

        QualifiedName valueName = annotationAST.newQualifiedName(annotationAST.newSimpleName("RequestMethod"),
            annotationAST.newSimpleName(methodTypeString));
        pair.setValue(valueName);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newMemberValuePair()

          true, null);

      for (int i = 0; i < params.length; i++) {
        switch (params[i]) {
        case REQUIRED:
          MemberValuePair requiredValue = ast.newMemberValuePair();
          requiredValue.setName(ast.newSimpleName("required"));
          requiredValue.setValue(ast.newBooleanLiteral(false));
          addLinkedPosition(astRewrite.track(requiredValue.getValue()), i == 0, "Autowire");
          autowiredAnnotation.values().add(requiredValue);
          break;
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.