Package org.eclipse.jdt.core.dom

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


      if (s instanceof VariableDeclarationStatement) {
        if (wasCase) {
          println();
        }
        VariableDeclarationStatement vds = (VariableDeclarationStatement) s;

        for (VariableDeclarationFragment fragment : (Iterable<VariableDeclarationFragment>) vds
            .fragments()) {
          if (fragment.getInitializer() != null) {
            printi();
            fragment.getName().accept(this);
            print(" = ");
View Full Code Here


    processChildren(nodes, context, new ChildProcessor() {
      @Override
      public void processChild(ASTNode node, ProcessingContext context) {
        graph.addMapping(node, context.previousVertice, context.nextVertice);
        if (newVariablesAsAssignments && node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT){
          VariableDeclarationStatement vds = (VariableDeclarationStatement) node;
          processVariableDeclarationFragments(vds.fragments(), context, true, bc);
        } else
          acceptChild(node, context);
      }
    });
  }
View Full Code Here

  private List<SimpleName> findBlockVariables(List<?> statements) {
    List<SimpleName> result = new LinkedList<SimpleName>();
    for(Object obj: statements) {
      ASTNode node = (ASTNode) obj;
      if (node.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT) {
        VariableDeclarationStatement vds = (VariableDeclarationStatement) node;
        for(Object fragmentObj: vds.fragments())
          result.add(((VariableDeclarationFragment)fragmentObj).getName());
      }
    }
    return result;
  }
View Full Code Here

              // param
              // list [metohd(param, ^)]
              if (parentNode instanceof VariableDeclarationFragment) {
                parentNode = parentNode.getParent();
                if (parentNode instanceof VariableDeclarationStatement) {
                  VariableDeclarationStatement varDeclStmt = (VariableDeclarationStatement) parentNode;
                  Type varDeclType = varDeclStmt.getType();
                  if (varDeclType instanceof SimpleType) {
                    SimpleType sType = (SimpleType) varDeclType;
                    parentNode = parentNode.getParent();
                    if (parentNode instanceof Block) {
                      Block block = (Block) parentNode;
View Full Code Here

TOP

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

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.