Examples of ClassInstanceCreation


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

        VariableDeclarationFragment fragment = ast
                .newVariableDeclarationFragment();
        fragment.setName(ast.newSimpleName(CHECKPOINT_NAME));

        ClassInstanceCreation checkpoint = ast.newClassInstanceCreation();
        String typeName = getClassName(Checkpoint.class, state, root);
        checkpoint.setType(ast.newSimpleType(createName(ast, typeName)));
        checkpoint.arguments().add(ast.newThisExpression());
        fragment.setInitializer(checkpoint);

        FieldDeclaration checkpointField = ast.newFieldDeclaration(fragment);
        checkpointField.setType(createType(ast, typeName));
View Full Code Here

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

        VariableDeclarationFragment fragment = ast
                .newVariableDeclarationFragment();
        fragment.setName(ast.newSimpleName(CHECKPOINT_RECORD_NAME));

        ClassInstanceCreation creation = ast.newClassInstanceCreation();
        String typeName = getClassName(CheckpointRecord.class, state, root);
        creation.setType(ast.newSimpleType(createName(ast, typeName)));
        fragment.setInitializer(creation);

        FieldDeclaration record = ast.newFieldDeclaration(fragment);
        record.setType(createType(ast, typeName));
        record.modifiers().add(
View Full Code Here

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

                .newVariableDeclarationFragment();
        fragment.setName(ast.newSimpleName(recordName));

        // Create the initializer, and use the number of dimensions as its
        // argument.
        ClassInstanceCreation initializer = ast.newClassInstanceCreation();
        initializer.setType(ast.newSimpleType(createName(ast, typeName)));
        initializer.arguments().add(
                ast.newNumberLiteral(Integer.toString(dimensions)));
        fragment.setInitializer(initializer);

        // The field declaration.
        FieldDeclaration field = ast.newFieldDeclaration(fragment);
View Full Code Here

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

     @return The expression that evaluates to a {@link Rollbackable} object
     *   at run-time.
     */
    private Expression _createRollbackableObject(AST ast, boolean isAnonymous) {
        if (isAnonymous) {
            ClassInstanceCreation proxy = ast.newClassInstanceCreation();
            proxy
                    .setType(ast.newSimpleType(ast
                            .newSimpleName(_getProxyName())));
            return proxy;
        } else {
            return ast.newThisExpression();
View Full Code Here

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

            MethodInvocation addInvocation = ast.newMethodInvocation();
            addInvocation.setExpression(ast.newSimpleName(CHECKPOINT_NAME));
            addInvocation.setName(ast.newSimpleName("addObject"));

            ClassInstanceCreation proxy = ast.newClassInstanceCreation();
            proxy
                    .setType(ast.newSimpleType(ast
                            .newSimpleName(_getProxyName())));
            addInvocation.arguments().add(proxy);
            body.statements().add(ast.newExpressionStatement(addInvocation));
            bodyDeclarations.add(initializer);
View Full Code Here

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

        MethodInvocation mi = (MethodInvocation) loc.getASTNode();
        Expression s=mi.getExpression();
        fullCalleeName = mi.getName().getFullyQualifiedName();
      }else
        if(loc.getASTNode() instanceof ClassInstanceCreation) {
            ClassInstanceCreation mi = (ClassInstanceCreation) loc.getASTNode();
        fullCalleeName = mi.getType().toString();
      }
       
        if(fullCalleeName != null) {
        if(SourceView.isSourceName(fullCalleeName)) {
          return display.getSystemColor(SWT.COLOR_DARK_RED);
View Full Code Here

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

        processExpression(arrAccess, ae.getArray(),  cu, resource, stack, monitor, HistoryDefinitionLocation.ARRAYACCESS,false);
     
    }
    else if(e instanceof ClassInstanceCreation)
    {
      ClassInstanceCreation c=(ClassInstanceCreation)e;
      HistoryDefinitionLocation cc;
      if(!first){
      cc= new HistoryDefinitionLocation(
          e.toString(),
          resource,
          cu.getLineNumber(e.getStartPosition()),
          e,
          parent, HistoryDefinitionLocation.CLASS_INSTANCE_CREATION);
      }else
        cc=parent;
      String aux=(c.getType()).toString();
      if(SinkView.isDerivationName(aux)){
        for(Object arg:c.arguments()){
          if(registerExpansion(cc))
          processExpression(cc,(Expression)arg,cu,resource,stack,monitor,HistoryDefinitionLocation.DERIVATION,false);
        }
    }
      }
View Full Code Here

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

          addHistoryEntry(dl);
          fContentProvider.addElement(dl);
          refresh();
        }
       else if(covering instanceof ClassInstanceCreation) {
         ClassInstanceCreation ae=(ClassInstanceCreation)covering;
         HistoryDefinitionLocation dl = new HistoryDefinitionLocation(
              ae.toString(),
              (IFile)resource,
              unit.getLineNumber(0),
              covering,null, HistoryDefinitionLocation.CLASS_INSTANCE_CREATION);
          processExpression(dl, ae, unit, resource, new LinkedList<MethodInvocation>(), monitor, HistoryDefinitionLocation.CALL,true);
          setCurrentInput(dl);
View Full Code Here

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

                                    if (argCount > 0) {
                                        arg = (Expression) mi.arguments().get(argumentNumber);
                                    }
                                   
                                } else if (expr instanceof ClassInstanceCreation) {
                                    ClassInstanceCreation ci = (ClassInstanceCreation) expr;
                                    argCount = ci.arguments().size();
                                    if (argCount > 0) {
                                        arg = (Expression) ci.arguments().get(argumentNumber);
                                    }
                                  
                                } else {
                                    logError("Can't match " + expr + " of type " + expr.getClass());
                                 
View Full Code Here

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

             
              ASTNode varDeclarationFragment = node.getParent();
              if (varDeclarationFragment instanceof VariableDeclarationFragment) {
                VariableDeclarationFragment vdf = (VariableDeclarationFragment) varDeclarationFragment;
               
                ClassInstanceCreation newClassInstanceCreation = vdf.getAST().newClassInstanceCreation();
                Type newType = JDTUtils.createQualifiedType(vdf.getAST(), toClass);
                newClassInstanceCreation.setType(newType);
                List arguments = newClassInstanceCreation.arguments();
                arguments.clear();
               
                MethodInvocation initializer = (MethodInvocation) vdf.getInitializer();
                List newArguments = ASTNode.copySubtrees(newClassInstanceCreation.getAST(), initializer.arguments());
                arguments.addAll(newArguments);
                 
                vdf.setInitializer(newClassInstanceCreation);
              }
            }
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.