Package org.eclipse.jdt.core.dom

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


    SingleVariableDeclaration declaration = ast.newSingleVariableDeclaration();

    Type type = simpleTypeInfo.toType(ast);
    declaration.setType(type);

    SimpleName variableName = ast.newSimpleName(name);
    declaration.setName(variableName);

    return declaration;
  }
View Full Code Here


    this.block = block;
    this.getterInfo = getterInfo;
  }

  public CallOn on(String name) {
    SimpleName theName = ast.newSimpleName(name);
    return new CallOn(theName);
  }
View Full Code Here

      MethodInvocation invocation = getterInfo.toMethodInvocation(ast, name);
      assignment.setRightHandSide(invocation);
      assignment.setOperator(Operator.ASSIGN);

      SimpleName assignTo = fieldInfo.toSimpleName(ast);
      assignment.setLeftHandSide(assignTo);
    }
View Full Code Here

  public MethodDeclarationWriter addConstructor() {
    MethodDeclaration method = ast.newMethodDeclaration();
    method.setConstructor(true);
    type.bodyDeclarations().add(method);

    SimpleName name = type.getName();
    method.setName(ast.newSimpleName(name.getIdentifier()));

    return new MethodDeclarationWriter(method);
  }
View Full Code Here

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

  public TypeDeclarationWriter namedAfter(SimpleTypeInfo typeInfo, String suffix) {
    SimpleName name = typeInfo.newNameSuffix(ast, suffix);
    type.setName(name);
    return this;
  }
View Full Code Here

    type.setName(name);
    return this;
  }

  public TypeDeclarationWriter namedAfter(TypeInfo typeInfo, String suffix) {
    SimpleName name = typeInfo.toSimpleNameSuffix(ast, suffix);
    type.setName(name);
    return this;
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public MethodDeclaration toMethodDeclaration(AST ast) {
    MethodDeclaration method = ast.newMethodDeclaration();

    SimpleName methodName = ast.newSimpleName(name);
    method.setName(methodName);

    accessInfo.writeTo(method);
    returnTypeInfo.writeTo(ast, method);
View Full Code Here

    return name;
  }

  @Override
  public Type toType(AST ast) {
    SimpleName name = ast.newSimpleName(this.name);
    return ast.newSimpleType(name);
  }
View Full Code Here

     * @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#consumes(org.eclipse.jdt.internal.ui.javaeditor.SemanticToken)
     */
    public boolean consumes(SemanticToken token) {

      // 1: match types in type parameter lists
      SimpleName name= token.getNode();
      ASTNode node= name.getParent();
      if (node.getNodeType() != ASTNode.SIMPLE_TYPE && node.getNodeType() != ASTNode.TYPE_PARAMETER)
        return false;

      // 2: match generic type variable references
      IBinding binding= token.getBinding();
View Full Code Here

     * @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#consumes(org.eclipse.jdt.internal.ui.javaeditor.SemanticToken)
     */
    public boolean consumes(SemanticToken token) {

      // 1: match types
      SimpleName name= token.getNode();
      ASTNode node= name.getParent();
      int nodeType= node.getNodeType();
      if (nodeType != ASTNode.SIMPLE_TYPE && nodeType != ASTNode.THIS_EXPRESSION && nodeType != ASTNode.QUALIFIED_TYPE  && nodeType != ASTNode.QUALIFIED_NAME && nodeType != ASTNode.TYPE_DECLARATION && nodeType != ASTNode.METHOD_INVOCATION)
        return false;
      while (nodeType == ASTNode.QUALIFIED_NAME) {
        node= node.getParent();
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.