Package org.eclipse.jdt.core.dom

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


    return new MethodDeclarationWriter(method);
  }

  public TypeDeclarationWriter implement(SimpleTypeInfo entity) {
    Type ifaceType = entity.toType(ast);
    type.superInterfaceTypes().add(ifaceType);
    return this;
  }
View Full Code Here


    type.superInterfaceTypes().add(ifaceType);
    return this;
  }

  public TypeDeclarationWriter implement(InterfaceInfo iface) {
    Type ifaceType = iface.toType(ast);
    type.superInterfaceTypes().add(ifaceType);
    return this;
  }
View Full Code Here

      return new ParameterInfoPojo(this);
    }

    @Override
    public SimpleTypeInfo getSimpleTypeInfo() {
      Type type = declaration.getType();
      return TypeWrapper.wrapperOf(type)
          .toSimpleTypeInfo();
    }
View Full Code Here

          .or(AccessInfo.DEFAULT);
    }

    @Override
    public SimpleTypeInfo getReturnTypeInfo() {
      Type type = declaration.getReturnType2();
      return TypeWrapper.wrapperOf(type)
          .toSimpleTypeInfo();
    }
View Full Code Here

      ImportRewrite importRewrite, FieldDeclaration oldFieldDeclaration,
      String fullyQualifiedTypeName) {
    final RefactoringStatus status = new RefactoringStatus();
    final AST ast = oldFieldDeclaration.getAST();
    final String typeName = importRewrite.addImport(fullyQualifiedTypeName);
    final Type newType = getNewType(ast, typeName);
    final Type oldType = oldFieldDeclaration.getType();
    astRewrite.replace(oldType, newType, null);
    return status;
  }
View Full Code Here

      String fullyQualifiedTypeName) {

    final RefactoringStatus status = new RefactoringStatus();
    final String typeName = importRewrite.addImport(fullyQualifiedTypeName);
    final AST ast = oldFormalParameterDeclaration.getAST();
    final Type newType = getNewType(ast, typeName);
    final Type oldType = oldFormalParameterDeclaration.getType();
    astRewrite.replace(oldType, newType, null);
    return status;
  }
View Full Code Here

      String fullyQualifiedTypeName) {

    final RefactoringStatus status = new RefactoringStatus();
    final AST ast = oldVariableDeclaration.getAST();
    final String typeName = importRewrite.addImport(fullyQualifiedTypeName);
    final Type newType = getNewType(ast, typeName);
    final Type oldType = oldVariableDeclaration.getType();
    astRewrite.replace(oldType, newType, null);
    return status;
  }
View Full Code Here

      String fullyQualifiedTypeName) {

    final RefactoringStatus status = new RefactoringStatus();
    final AST ast = oldMethodDeclaration.getAST();
    final String typeName = importRewrite.addImport(fullyQualifiedTypeName);
    final Type newType = getNewType(ast, typeName);
    final Type oldType = oldMethodDeclaration.getReturnType2();
    astRewrite.replace(oldType, newType, null);
    return status;
  }
View Full Code Here

     * <li> Variable declarations with initializer expression, e.g., <code>int local=1</code>
     * </ul>
     */
    protected void initDataType() {
        //        if (getDataType() == null) {
        Type declType = null;
        if (getASTNode() instanceof SingleVariableDeclaration) {
            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 {
                sLogger.warn("Parent of this variable declaration statement currently not supported " + getASTNode());
            }
        }

        ITypeBinding lTypeBinding = null;
        if (declType != null) {
            lTypeBinding = declType.resolveBinding();
        }
        FamixClass lDataType = getClass(lTypeBinding, declType, false);
        lDataType = (FamixClass) getModel().addElement(lDataType);
        setDataType(lDataType);
    }
View Full Code Here

        if (dataType == null) {
            lClassID = UNDEFINED_BINDING;
            sLogger.warn("Data type is null");
        } else {
            Type typeToResolve = dataType;
            if (dataType.isParameterizedType()) {
                typeToResolve = ((ParameterizedType) dataType).getType();
            }   
            if (typeToResolve.isArrayType()) {
                lClassID = AbstractFamixEntity.ARRAY_TYPE_NAME;
            } else if (typeToResolve.isPrimitiveType()) {
                lClassID = ((PrimitiveType) typeToResolve).getPrimitiveTypeCode().toString();
            } else if (typeToResolve.isSimpleType()) {
                lClassID = convertSimpleName(((SimpleType) typeToResolve).getName());
            }
           
            // handling type parameters - adding a wild card for each unresolved type parameter
            if (dataType.isParameterizedType()) {
View Full Code Here

TOP

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

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.