Examples of ClassInstanceCreation


Examples of com.dragome.compiler.ast.ClassInstanceCreation

  {
    Expression rhs= a.getRightHandSide();

    if (rhs instanceof ClassInstanceCreation)
    {
      ClassInstanceCreation cic= (ClassInstanceCreation) rhs;
      if (cic.getTypeBinding().toString().equals("java.lang.String"))
      {
        return;
      }
    }
View Full Code Here

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

     *
     * @param type actual type
     * @return instance creation
     */
    public NewInstanceBuilder newInstance(Type type) {
        ClassInstanceCreation create = getAST().newClassInstanceCreation();
        create.setType(type);
        return new NewInstanceBuilder(this, create);
    }
View Full Code Here

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

     * @param type simple type name
     * @param value string value to be passed to constructor
     * @return instance creation
     */
    public NewInstanceBuilder newInstanceFromString(String type, String value) {
        ClassInstanceCreation create = getAST().newClassInstanceCreation();
        create.setType(createType(type));
        StringLiteral literal = getAST().newStringLiteral();
        literal.setLiteralValue(value);
        create.arguments().add(literal);
        return new NewInstanceBuilder(this, create);
    }
View Full Code Here

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

     * @param value1 first string value to be passed to constructor
     * @param value2 second string value to be passed to constructor
     * @return instance creation
     */
    public NewInstanceBuilder newInstanceFromStrings(String type, String value1, String value2) {
        ClassInstanceCreation create = getAST().newClassInstanceCreation();
        create.setType(createType(type));
        StringLiteral literal = getAST().newStringLiteral();
        literal.setLiteralValue(value1);
        create.arguments().add(literal);
        literal = getAST().newStringLiteral();
        literal.setLiteralValue(value2);
        create.arguments().add(literal);
        return new NewInstanceBuilder(this, create);
    }
View Full Code Here

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

     * @param type exception type
     * @param text
     */
    public void addThrowException(String type, String text) {
        ThrowStatement thrwstmt = m_ast.newThrowStatement();
        ClassInstanceCreation exexpr = m_ast.newClassInstanceCreation();
        exexpr.setType(m_ast.newSimpleType(m_ast.newSimpleName(type)));
        exexpr.arguments().add(stringLiteral(text));
        thrwstmt.setExpression(exexpr);
        m_block.statements().add(thrwstmt);
    }
View Full Code Here

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

     * @param type exception type
     * @param expr initializer expression
     */
    public void addThrowException(String type, ExpressionBuilderBase expr) {
        ThrowStatement thrwstmt = m_ast.newThrowStatement();
        ClassInstanceCreation exexpr = m_ast.newClassInstanceCreation();
        exexpr.setType(m_ast.newSimpleType(m_ast.newSimpleName(type)));
        exexpr.arguments().add(expr.getExpression());
        thrwstmt.setExpression(exexpr);
        m_block.statements().add(thrwstmt);
    }
View Full Code Here

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

      ITypeBinding typePar = ASTUtil.getFirstTypeParameter(node);
      ASTNode parent = node.getParent();

      if (parent instanceof ClassInstanceCreation && typePar.isInterface()  ) // creating interface mock
      {
        ClassInstanceCreation creation = (ClassInstanceCreation) parent;

        visitMockUpCreation(creation);
      }

    }
View Full Code Here

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

  {
    ITypeBinding declaringType = null;

    if( node.getParent() instanceof ClassInstanceCreation ) // for anonymous
    {
      ClassInstanceCreation creation = (ClassInstanceCreation) node.getParent();
      Type ctype = creation.getType();

      declaringType = getFirstTypeParam(ctype);
    }
    else if( node instanceof TypeDeclaration )
    {
View Full Code Here

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

        // check QualifiedName for search results as well -
        // happens if import package is already added but exported package has been removed
        if (selectedNode instanceof ClassInstanceCreation)
        {
            ClassInstanceCreation c = (ClassInstanceCreation) selectedNode;
            Type t = c.getType();
            Name node = findName(t);
            if (node != null)
            {
                addSearchResults(node, project, results);
            }
View Full Code Here

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

  protected boolean processAddListenerStatement(TypeDeclaration type, WidgetAdapter adapter, EventSetDescriptor esd, MethodDescriptor mListener, MethodInvocation mi) {
    List arguments = mi.arguments();
    for (Object arg : arguments) {
      Expression argExpression = (Expression) arg;
      if (argExpression instanceof ClassInstanceCreation) {
        ClassInstanceCreation cic = (ClassInstanceCreation) argExpression;
        AnonymousClassDeclaration acd = cic.getAnonymousClassDeclaration();
        if (acd != null) {
          if (parse(adapter, esd, mListener, cic))
            return true;
        } else
          return false;
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.