Package org.eclipse.jdt.core.dom

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


        this.buffer.append(" ");//$NON-NLS-1$
      }
      if (!superInterfaces(node).isEmpty()) {
        this.buffer.append(node.isInterface() ? "extends " : "implements ");//$NON-NLS-2$//$NON-NLS-1$
        for (Iterator it = superInterfaces(node).iterator(); it.hasNext(); ) {
          Name n = (Name) it.next();
          n.accept(this);
          if (it.hasNext()) {
            this.buffer.append(", ");//$NON-NLS-1$
          }
        }
        this.buffer.append(" ");//$NON-NLS-1$
View Full Code Here


  int length = charFragments.length;
  String[] strFragments = new String[length];
  for (int i = 0; i < length; i++) {
    strFragments[i] = String.valueOf(charFragments[i]);
  }
  Name name = ast.newName(strFragments);
  importDeclaration.setName(name);
  if (onDemand) importDeclaration.setOnDemand(true);
  return importDeclaration;
}
View Full Code Here

      }
    } else {
      org.eclipse.jdt.core.dom.PackageDeclaration pkg = astCU.getPackage();
      if (pkg != null) {
        // rename package statement
        Name name = ast.newName(pkgName);
        rewriter.set(pkg, PackageDeclaration.NAME_PROPERTY, name, null);
      } else {
        // create new package statement
        pkg = ast.newPackageDeclaration();
        pkg.setName(ast.newName(pkgName));
View Full Code Here

            }
         }
         else
         {
            String[] className = Types.tokenizeClassName(typeName);
            Name name = ast.newName(className);
            type = ast.newSimpleType(name);
         }
      }
      field.setType(type);
      return this;
View Full Code Here

            }
         }
         else
         {
            String[] className = Types.tokenizeClassName(typeName);
            Name name = ast.newName(className);
            type = ast.newSimpleType(name);
         }
      }
      member.setType(type);
      return this;
View Full Code Here

    IBinding x = node.resolveBinding();
    if (x instanceof ITypeBinding) {
      hardDep((ITypeBinding) x);
      print(CName.relative((ITypeBinding) x, type, true));
    } else {
      Name qualifier = node.getQualifier();
      IBinding b = qualifier.resolveBinding();
      if (b instanceof ITypeBinding) {
        hardDep((ITypeBinding) b);
        print(CName.relative((ITypeBinding) b, type, true) + "::");
      } else if (b instanceof IVariableBinding) {
        IVariableBinding vb = (IVariableBinding) b;
        hardDep(vb.getType());

        boolean hidden = false;
        if (x instanceof IVariableBinding) {
          hidden = hidden(vb.getType(), (IVariableBinding) x);
        }

        if (hidden) {
          staticCast(qualifier.resolveTypeBinding(),
              ((IVariableBinding) x).getDeclaringClass());
        }

        npcAccept(qualifier);

        if (hidden) {
          print(")");
        }

        print("->");

      } else if (b instanceof IPackageBinding) {
        qualifier.accept(this);
        print("::");
      } else {
        throw new Error("Unknown binding " + b.getClass());
      }
View Full Code Here

          }
        }
      }

      if (node instanceof Name) {
        Name name = ((Name) node);
        IBinding b = name.resolveBinding();
        if (b instanceof IVariableBinding) {
          IVariableBinding vb = (IVariableBinding) b;
          castName(node, name, vb);
        }
      }
View Full Code Here

            .getInitializer()) {
      return;
    }

    if (parent instanceof Name) {
      Name p = (Name) parent;
      if (p.resolveBinding().isEqualTo(vb)) {
        return;
      }
    }

    if (parent instanceof FieldAccess) {
View Full Code Here

  @Override
  public PackageDeclaration newPackageDeclaration(AST ast) {
    PackageDeclaration declaration = ast.newPackageDeclaration();

    Name theName = ast.newName(name);
    declaration.setName(theName);

    return declaration;
  }
View Full Code Here

    private final QualifiedName name;

    public MetaImportAst(Jdt jdt, ImportDeclaration ast) {
      this.jdt = jdt;
      this.ast = ast;
      Name name = ast.getName();
      this.name = QualifiedName.class.cast(name);
    }
View Full Code Here

TOP

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

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.