Package org.eclipse.jdt.core.dom

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


      return status;
    }

    // Make a copy of the simple name.
    final AST ast = name.getAST();
    final SimpleName nameCopy = (SimpleName) ASTNode.copySubtree(ast, name);

    final String typeName = importRewrite.addImport(fullyQualifiedTypeName);
    final QualifiedName newNameNode = ast.newQualifiedName(ast
        .newName(typeName), nameCopy);
View Full Code Here


      }
      if (!(invocation.getExpression() instanceof SimpleName)) {
        return null;
      }
      //
      SimpleName field = (SimpleName) invocation.getExpression();
      String bundleName = AstNodeUtils.getFullyQualifiedName(field, true);
      String fieldName = field.getIdentifier();
      //
      SimpleName keyExpression = invocation.getName();
      String key = keyExpression.getIdentifier();
      //
      ExpressionInfo expressionInfo =
          new ExpressionInfo(expression, bundleName, fieldName, keyExpression, key);
      expression.setProperty(NLS_EXPRESSION_INFO, expressionInfo);
      return expressionInfo;
View Full Code Here

        if (node instanceof SimpleType) {
          SimpleType simpleType = (SimpleType) node;
          ITypeBinding typeBinding = simpleType.resolveBinding();
          checkNode(node, typeBinding);
        } else if (node instanceof SimpleName) {
          SimpleName simpleName = (SimpleName) node;
          if (simpleName.resolveBinding().getKind() == IBinding.TYPE
              && node.getLocationInParent() == MethodInvocation.EXPRESSION_PROPERTY) {
            ITypeBinding typeBinding = simpleName.resolveTypeBinding();
            checkNode(node, typeBinding);
          }
        }
      }
View Full Code Here

      if (identifier.equals("int")) {
        identifier = "Integer";
      } else {
        identifier = StringUtils.capitalize(identifier);
      }
      SimpleName typeName = type.getAST().newSimpleName(identifier);
      return type.getAST().newSimpleType(typeName);
    } else {
      return type;
    }
  }
View Full Code Here

      if (!packg.isEmpty())
      {
         getOrigin().addImport(type);
      }

      SimpleName simpleName = method.getAST().newSimpleName(name);

      List list = (List) method.getStructuralProperty(MethodDeclaration.THROWN_EXCEPTIONS_PROPERTY);
      list.add(simpleName);

      return this;
View Full Code Here

      if (!packg.isEmpty())
      {
         getOrigin().addImport(type);
      }

      SimpleName simpleName = method.getAST().newSimpleName(name);

      List list = (List) method.getStructuralProperty(MethodDeclaration.THROWN_EXCEPTION_TYPES_PROPERTY);
      list.add(method.getAST().newSimpleType(simpleName));

      return this;
View Full Code Here

   }

   @Override
   public String getName()
   {
      SimpleName name = param.getName();
      if (name != null)
      {
         return name.toString();
      }
      return "";
   }
View Full Code Here

      if (!packg.isEmpty())
      {
         getOrigin().addImport(type);
      }

      SimpleName simpleName = method.getAST().newSimpleName(name);

      List list = (List) method.getStructuralProperty(MethodDeclaration.THROWN_EXCEPTIONS_PROPERTY);
      list.add(simpleName);

      return this;
View Full Code Here

      if (!packg.isEmpty())
      {
         getOrigin().addImport(type);
      }

      SimpleName simpleName = method.getAST().newSimpleName(name);

      List list = (List) method.getStructuralProperty(MethodDeclaration.THROWN_EXCEPTION_TYPES_PROPERTY);
      list.add(method.getAST().newSimpleType(simpleName));

      return this;
View Full Code Here

        TypeDeclaration type = getTypeDeclaration(workingUnit, bug.getPrimaryClass());
        MethodDeclaration method = getMethodDeclaration(type, bug.getPrimaryMethod());

        String fieldName = bug.getPrimaryField().getFieldName();
        SimpleName original = null;

        for (Statement stmt : (List<Statement>) method.getBody().statements()) {
            if (stmt instanceof ReturnStatement) {
                Expression retEx = ((ReturnStatement) stmt).getExpression();
View Full Code Here

TOP

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

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.