Package japa.parser.ast.expr

Examples of japa.parser.ast.expr.StringLiteralExpr


    PackageDeclaration pkg = pkgFile.assertPackage();
    pkg.getAnnotations().clear();
    List<AnnotationExpr> a = Collections.<AnnotationExpr>singletonList(new NormalAnnotationExpr(ASTHelper.createNameExpr(
        Application.class.getName()),
        Collections.<MemberValuePair>singletonList(new MemberValuePair(
            "name", new StringLiteralExpr("abc")
        ))));
    pkg.setAnnotations(a);
    pkgFile.assertSave();

    //
View Full Code Here


    SingleMemberAnnotationExpr applicationDecl = (SingleMemberAnnotationExpr)a.getAnnotations().get(0);
    NormalAnnotationExpr tagDecl = (NormalAnnotationExpr)applicationDecl.getMemberValue();
    boolean changed = false;
    for (MemberValuePair pair : tagDecl.getPairs()) {
      if (pair.getName().equals("path")) {
        pair.setValue(new StringLiteralExpr("bar.gtmpl"));
        changed = true;
      }
    }
    assertTrue(changed);
    file.assertSave();
View Full Code Here

  }

  @Override
  public Node visit(StringLiteralExpr _n, Object _arg) {
    Comment comment = cloneNodes(_n.getComment(), _arg);
    StringLiteralExpr r = new StringLiteralExpr(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        _n.getValue()
    );
    r.setComment(comment);
    return r;
  }
View Full Code Here

    return Boolean.TRUE;
  }

  @Override public Boolean visit(final StringLiteralExpr n1, final Node arg) {
    final StringLiteralExpr n2 = (StringLiteralExpr) arg;

    if (!objEquals(n1.getValue(), n2.getValue())) {
      return Boolean.FALSE;
    }

    return Boolean.TRUE;
  }
View Full Code Here

TOP

Related Classes of japa.parser.ast.expr.StringLiteralExpr

Copyright © 2018 www.massapicom. 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.