Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.VariableDeclarationFragment.resolveBinding()


  /** (non-Javadoc)
   * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.VariableDeclarationFragment)
   */
  public boolean visit(VariableDeclarationFragment node) {
    VariableDeclarationFragment vdf = (VariableDeclarationFragment) node;
    IVariableBinding binding = vdf.resolveBinding();
    localVariables.add(new VarProposal(binding, "Local"));
    return true;
  }

  /**
 
View Full Code Here


    case ASTNode.VARIABLE_DECLARATION_STATEMENT: {
      final VariableDeclarationStatement vds = (VariableDeclarationStatement) node;
      for (final Iterator it = vds.fragments().iterator(); it.hasNext();) {
        final VariableDeclarationFragment vdf = (VariableDeclarationFragment) it
            .next();
        final IJavaElement elem = vdf.resolveBinding().getJavaElement();
        if (elem.isReadOnly() || vdf.getName().resolveBoxing())
          throw new DefinitelyNotEnumerizableException(
              Messages.ASTNodeProcessor_SourceNotPresent, vdf);
        if (vdf.resolveBinding().getType().isEqualTo(
            node.getAST().resolveWellKnownType("java.lang.Object"))) //$NON-NLS-1$
View Full Code Here

            .next();
        final IJavaElement elem = vdf.resolveBinding().getJavaElement();
        if (elem.isReadOnly() || vdf.getName().resolveBoxing())
          throw new DefinitelyNotEnumerizableException(
              Messages.ASTNodeProcessor_SourceNotPresent, vdf);
        if (vdf.resolveBinding().getType().isEqualTo(
            node.getAST().resolveWellKnownType("java.lang.Object"))) //$NON-NLS-1$
          throw new NonEnumerizableASTException(
              Messages.ASTNodeProcessor_IllegalArrayUpcast, vdf);
        this.found.add(elem);
        this.processExpression(vdf.getInitializer());
View Full Code Here

      break;
    }

    case ASTNode.VARIABLE_DECLARATION_FRAGMENT: {
      final VariableDeclarationFragment vdf = (VariableDeclarationFragment) node;
      final IJavaElement elem = vdf.resolveBinding().getJavaElement();
      if (!this.constFields.contains(elem)) {
        if (elem == null || vdf == null || vdf.getName() == null)
          throw new DefinitelyNotEnumerizableException(
              Messages.ASTNodeProcessor_SourceNotPresent, node);
        if (elem.isReadOnly() || vdf.getName().resolveBoxing())
View Full Code Here

          throw new DefinitelyNotEnumerizableException(
              Messages.ASTNodeProcessor_SourceNotPresent, node);
        if (elem.isReadOnly() || vdf.getName().resolveBoxing())
          throw new DefinitelyNotEnumerizableException(
              Messages.ASTNodeProcessor_SourceNotPresent, node);
        if (vdf.resolveBinding().getType().isEqualTo(
            node.getAST().resolveWellKnownType("java.lang.Object"))) //$NON-NLS-1$
          throw new NonEnumerizableASTException(
              Messages.ASTNodeProcessor_IllegalArrayUpcast, vdf);
        this.found.add(elem);
        this.processExpression(vdf.getInitializer());
View Full Code Here

    case ASTNode.FIELD_DECLARATION: {
      final FieldDeclaration fd = (FieldDeclaration) node;
      for (final Iterator it = fd.fragments().iterator(); it.hasNext();) {
        final VariableDeclarationFragment vdf = (VariableDeclarationFragment) it
            .next();
        final IJavaElement elem = vdf.resolveBinding().getJavaElement();
        if (!this.constFields.contains(elem)) {
          if (elem.isReadOnly() || vdf.getName().resolveBoxing())
            throw new DefinitelyNotEnumerizableException(
                Messages.ASTNodeProcessor_SourceNotPresent, vdf);
          if (vdf.resolveBinding().getType().isEqualTo(
View Full Code Here

        final IJavaElement elem = vdf.resolveBinding().getJavaElement();
        if (!this.constFields.contains(elem)) {
          if (elem.isReadOnly() || vdf.getName().resolveBoxing())
            throw new DefinitelyNotEnumerizableException(
                Messages.ASTNodeProcessor_SourceNotPresent, vdf);
          if (vdf.resolveBinding().getType().isEqualTo(
              node.getAST().resolveWellKnownType(
                  "java.lang.Object"))) //$NON-NLS-1$
            throw new NonEnumerizableASTException(
                Messages.ASTNodeProcessor_IllegalArrayUpcast, vdf);
          this.found.add(elem);
View Full Code Here

      final VariableDeclarationExpression varDec = (VariableDeclarationExpression) node;
      for (final Iterator it = varDec.fragments().iterator(); it
          .hasNext();) {
        final VariableDeclarationFragment vdf = (VariableDeclarationFragment) it
            .next();
        final IJavaElement elem = vdf.resolveBinding().getJavaElement();
        if (elem.isReadOnly() || vdf.getName().resolveBoxing())
          throw new DefinitelyNotEnumerizableException(
              Messages.ASTNodeProcessor_SourceNotPresent, vdf);
        if (vdf.resolveBinding().getType().isEqualTo(
            node.getAST().resolveWellKnownType("java.lang.Object"))) //$NON-NLS-1$
View Full Code Here

            .next();
        final IJavaElement elem = vdf.resolveBinding().getJavaElement();
        if (elem.isReadOnly() || vdf.getName().resolveBoxing())
          throw new DefinitelyNotEnumerizableException(
              Messages.ASTNodeProcessor_SourceNotPresent, vdf);
        if (vdf.resolveBinding().getType().isEqualTo(
            node.getAST().resolveWellKnownType("java.lang.Object"))) //$NON-NLS-1$
          throw new NonEnumerizableASTException(
              Messages.ASTNodeProcessor_IllegalArrayUpcast, vdf);
        this.found.add(elem);
      }
View Full Code Here

      // VariableDeclarationFragment: is the plain variable declaration
      // part. Example:
      // "int x=0, y=0;" contains two VariableDeclarationFragments, "x=0"
      // and "y=0"

      IVariableBinding binding = fragment.resolveBinding();
      VariableBindingManager manager = new VariableBindingManager(
          fragment); // create the manager fro the fragment
      localVariableManagers.put(binding, manager);
      manager.variableInitialized(fragment.getInitializer());
      // first assignment is the initalizer
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.