Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.VariableDeclarationExpression


        BlockBuilder block) {
        ForStatement stmt = m_ast.newForStatement();
        VariableDeclarationFragment declfrag = m_ast.newVariableDeclarationFragment();
        declfrag.setName(m_ast.newSimpleName(name));
        declfrag.setInitializer(init);
        VariableDeclarationExpression varexpr = m_ast.newVariableDeclarationExpression(declfrag);
        varexpr.setType(type);
        stmt.initializers().add(varexpr);
        stmt.setExpression(test);
        if (post != null) {
            stmt.updaters().add(post);
        }
View Full Code Here


      if (parent.getJavadoc() != null) {
        parent.getJavadoc().accept(this);
      }
    }
    else if (parentASTNode instanceof VariableDeclarationExpression) {
      VariableDeclarationExpression parent = (VariableDeclarationExpression)parentASTNode;
      parent.getType().accept(this);
      visitListOfModifiers(parent.modifiers());
    }
    else {
      VariableDeclarationStatement parent = (VariableDeclarationStatement)parentASTNode;
      parent.getType().accept(this);
      visitListOfModifiers(parent.modifiers());
    }
    scopeManager.pop();
    return true;
  }
View Full Code Here

    List resources = node.resources();
    if (node.getAST().apiLevel() >= AST.JLS4) {
      if (!node.resources().isEmpty()) {
        this.buffer.append('(');
        for (Iterator it = resources.iterator(); it.hasNext(); ) {
          VariableDeclarationExpression variable = (VariableDeclarationExpression) it.next();
          variable.accept(this);
          if (it.hasNext()) {
            this.buffer.append(';');
          }
        }
        this.buffer.append(')');
View Full Code Here

      }
      break;
    }

    case ASTNode.VARIABLE_DECLARATION_EXPRESSION: {
      final VariableDeclarationExpression varDec = (VariableDeclarationExpression) node;
      for (final Iterator it = varDec.fragments().iterator(); it
          .hasNext();) {
        final VariableDeclarationFragment vdf = (VariableDeclarationFragment) it
            .next();
        final IJavaElement elem = vdf.resolveBinding().getJavaElement();
        if (elem.isReadOnly() || vdf.getName().resolveBoxing())
View Full Code Here

            SingleVariableDeclaration singleVarDecl = (SingleVariableDeclaration) getASTNode();
            declType = singleVarDecl.getType();
        } else {
            ASTNode parentNode = getASTNode().getParent();
            if (parentNode instanceof VariableDeclarationExpression) {
                VariableDeclarationExpression varDeclExpression = (VariableDeclarationExpression) parentNode;
                declType = varDeclExpression.getType();
   
            } else if (parentNode instanceof VariableDeclarationStatement) {
                VariableDeclarationStatement varDeclStatement = (VariableDeclarationStatement) parentNode;
                declType = varDeclStatement.getType();
            } else {
View Full Code Here

    if (node.getAST().apiLevel() >= AST.JLS4) {
      List resources = node.resources();
      if (!resources.isEmpty()) {
        this.buffer.append('(');
        for (Iterator it = resources.iterator(); it.hasNext(); ) {
          VariableDeclarationExpression variable = (VariableDeclarationExpression) it.next();
          variable.accept(this);
          if (it.hasNext()) {
            this.buffer.append(';');
          }
        }
        this.buffer.append(')');
View Full Code Here

    List<VariableDeclarationExpression> resources = node.resources();
    if (!node.resources().isEmpty()) {
      print("(");
      for (Iterator<VariableDeclarationExpression> it = resources
          .iterator(); it.hasNext();) {
        VariableDeclarationExpression variable = it.next();
        variable.accept(this);
        if (it.hasNext()) {
          print(";");
        }
      }
      print(")");
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.VariableDeclarationExpression

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.