org.eclipse.jdt.internal.compiler.lookup.BlockScope.getBinding()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(14.8k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中org.eclipse.jdt.internal.compiler.lookup.BlockScope.getBinding()方法的一些代码示例,展示了BlockScope.getBinding()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlockScope.getBinding()方法的具体详情如下:
包路径:org.eclipse.jdt.internal.compiler.lookup.BlockScope
类名称:BlockScope
方法名:getBinding

BlockScope.getBinding介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public boolean visit(SingleNameReference name, BlockScope skope) {
  Binding local = skope.getBinding(name.getName(), ReferenceExpression.this);
  if (local instanceof LocalVariableBinding) {
    LocalVariableBinding localBinding = (LocalVariableBinding) local;
    if (!localBinding.isFinal() && !localBinding.isEffectivelyFinal()) {
      this.accessesnonFinalOuterLocals = true;
    }
  }
  return false;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/ecj

public boolean visit(SingleNameReference name, BlockScope skope) {
  Binding local = skope.getBinding(name.getName(), ReferenceExpression.this);
  if (local instanceof LocalVariableBinding) {
    LocalVariableBinding localBinding = (LocalVariableBinding) local;
    if (!localBinding.isFinal() && !localBinding.isEffectivelyFinal()) {
      this.accessesnonFinalOuterLocals = true;
    }
  }
  return false;
}

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

public boolean visit(SingleNameReference name, BlockScope skope) {
  Binding local = skope.getBinding(name.getName(), ReferenceExpression.this);
  if (local instanceof LocalVariableBinding) {
    LocalVariableBinding localBinding = (LocalVariableBinding) local;
    if (!localBinding.isFinal() && !localBinding.isEffectivelyFinal()) {
      this.accessesnonFinalOuterLocals = true;
    }
  }
  return false;
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public boolean visit(SingleNameReference name, BlockScope skope) {
  Binding local = skope.getBinding(name.getName(), ReferenceExpression.this);
  if (local instanceof LocalVariableBinding) {
    LocalVariableBinding localBinding = (LocalVariableBinding) local;
    if (!localBinding.isFinal() && !localBinding.isEffectivelyFinal()) {
      this.accessesnonFinalOuterLocals = true;
    }
  }
  return false;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public boolean visit(SingleNameReference name, BlockScope skope) {
  Binding local = skope.getBinding(name.getName(), ReferenceExpression.this);
  if (local instanceof LocalVariableBinding) {
    LocalVariableBinding localBinding = (LocalVariableBinding) local;
    if (!localBinding.isFinal() && !localBinding.isEffectivelyFinal()) {
      this.accessesnonFinalOuterLocals = true;
    }
  }
  return false;
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public TypeBinding resolveType(BlockScope scope) {
  // it can be a package, type, member type, local variable or field
  this.binding = scope.getBinding(this.tokens, this);
  if (!this.binding.isValidBinding()) {
    if (this.binding instanceof ProblemFieldBinding) {
      scope.problemReporter().invalidField(this, (FieldBinding) this.binding);
    } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {
      scope.problemReporter().invalidType(this, (TypeBinding) this.binding);
    } else {
      scope.problemReporter().unresolvableReference(this, this.binding);
    }

    if (this.binding.problemId() == ProblemReasons.NotFound) {
      throw new CompletionNodeFound(this, this.binding, scope);
    }

    throw new CompletionNodeFound();
  }

  throw new CompletionNodeFound(this, this.binding, scope);
}
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public TypeBinding resolveType(BlockScope scope) {
  // it can be a package, type, member type, local variable or field
  this.binding = scope.getBinding(this.tokens, this);
  if (!this.binding.isValidBinding()) {
    if (this.binding instanceof ProblemFieldBinding) {
      scope.problemReporter().invalidField(this, (FieldBinding) this.binding);
    } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {
      scope.problemReporter().invalidType(this, (TypeBinding) this.binding);
    } else {
      scope.problemReporter().unresolvableReference(this, this.binding);
    }

    if (this.binding.problemId() == ProblemReasons.NotFound) {
      throw new CompletionNodeFound(this, this.binding, scope);
    }

    throw new CompletionNodeFound();
  }

  throw new CompletionNodeFound(this, this.binding, scope);
}
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public TypeBinding resolveType(BlockScope scope) {
  // it can be a package, type, member type, local variable or field
  this.binding = scope.getBinding(this.tokens, this);
  if (!this.binding.isValidBinding()) {
    if (this.binding instanceof ProblemFieldBinding) {
      scope.problemReporter().invalidField(this, (FieldBinding) this.binding);
    } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {
      scope.problemReporter().invalidType(this, (TypeBinding) this.binding);
    } else {
      scope.problemReporter().unresolvableReference(this, this.binding);
    }

    if (this.binding.problemId() == ProblemReasons.NotFound) {
      throw new CompletionNodeFound(this, this.binding, scope);
    }

    throw new CompletionNodeFound();
  }

  throw new CompletionNodeFound(this, this.binding, scope);
}
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public TypeBinding resolveType(BlockScope scope) {
  // it can be a package, type, member type, local variable or field
  this.binding = scope.getBinding(this.tokens, this);
  if (!this.binding.isValidBinding()) {
    if (this.binding instanceof ProblemFieldBinding) {
      scope.problemReporter().invalidField(this, (FieldBinding) this.binding);
    } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {
      scope.problemReporter().invalidType(this, (TypeBinding) this.binding);
    } else {
      scope.problemReporter().unresolvableReference(this, this.binding);
    }

    if (this.binding.problemId() == ProblemReasons.NotFound) {
      throw new CompletionNodeFound(this, this.binding, scope);
    }

    throw new CompletionNodeFound();
  }

  throw new CompletionNodeFound(this, this.binding, scope);
}
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public TypeBinding resolveType(BlockScope scope) {
  // it can be a package, type, member type, local variable or field
  this.binding = scope.getBinding(this.tokens, this);
  if (!this.binding.isValidBinding()) {
    if (this.binding instanceof ProblemFieldBinding) {
      scope.problemReporter().invalidField(this, (FieldBinding) this.binding);
    } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {
      scope.problemReporter().invalidType(this, (TypeBinding) this.binding);
    } else {
      scope.problemReporter().unresolvableReference(this, this.binding);
    }

    if (this.binding.problemId() == ProblemReasons.NotFound) {
      throw new CompletionNodeFound(this, this.binding, scope);
    }

    throw new CompletionNodeFound();
  }

  throw new CompletionNodeFound(this, this.binding, scope);
}
}

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

public TypeBinding resolveType(BlockScope scope) {
  // it can be a package, type, member type, local variable or field
  this.binding = scope.getBinding(this.tokens, this);
  if (!this.binding.isValidBinding()) {
    if (this.binding instanceof ProblemFieldBinding) {
      scope.problemReporter().invalidField(this, (FieldBinding) this.binding);
    } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {
      scope.problemReporter().invalidType(this, (TypeBinding) this.binding);
    } else {
      scope.problemReporter().unresolvableReference(this, this.binding);
    }

    if (this.binding.problemId() == ProblemReasons.NotFound) {
      throw new CompletionNodeFound(this, this.binding, scope);
    }

    throw new CompletionNodeFound();
  }

  throw new CompletionNodeFound(this, this.binding, scope);
}
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public TypeBinding resolveType(BlockScope scope) {
  // it can be a package, type, member type, local variable or field
  this.binding = scope.getBinding(this.tokens, this);
  if (!this.binding.isValidBinding()) {
    if (this.binding instanceof ProblemFieldBinding) {
      // tolerate some error cases
      if (this.binding.problemId() == ProblemReasons.NotVisible
          || this.binding.problemId() == ProblemReasons.InheritedNameHidesEnclosingName
          || this.binding.problemId() == ProblemReasons.NonStaticReferenceInConstructorInvocation
          || this.binding.problemId() == ProblemReasons.NonStaticReferenceInStaticContext) {
        throw new SelectionNodeFound(this.binding);
      }
      scope.problemReporter().invalidField(this, (FieldBinding) this.binding);
    } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {
      // tolerate some error cases
      if (this.binding.problemId() == ProblemReasons.NotVisible){
        throw new SelectionNodeFound(this.binding);
      }
      scope.problemReporter().invalidType(this, (TypeBinding) this.binding);
    } else {
      scope.problemReporter().unresolvableReference(this, this.binding);
    }
    throw new SelectionNodeFound();
  }
  throw new SelectionNodeFound(this.binding);
}
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public TypeBinding resolveType(BlockScope scope) {
  // it can be a package, type, member type, local variable or field
  this.binding = scope.getBinding(this.tokens, this);
  if (!this.binding.isValidBinding()) {
    if (this.binding instanceof ProblemFieldBinding) {
      // tolerate some error cases
      if (this.binding.problemId() == ProblemReasons.NotVisible
          || this.binding.problemId() == ProblemReasons.InheritedNameHidesEnclosingName
          || this.binding.problemId() == ProblemReasons.NonStaticReferenceInConstructorInvocation
          || this.binding.problemId() == ProblemReasons.NonStaticReferenceInStaticContext) {
        throw new SelectionNodeFound(this.binding);
      }
      scope.problemReporter().invalidField(this, (FieldBinding) this.binding);
    } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {
      // tolerate some error cases
      if (this.binding.problemId() == ProblemReasons.NotVisible){
        throw new SelectionNodeFound(this.binding);
      }
      scope.problemReporter().invalidType(this, (TypeBinding) this.binding);
    } else {
      scope.problemReporter().unresolvableReference(this, this.binding);
    }
    throw new SelectionNodeFound();
  }
  throw new SelectionNodeFound(this.binding);
}
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public TypeBinding resolveType(BlockScope scope) {
  // it can be a package, type, member type, local variable or field
  this.binding = scope.getBinding(this.tokens, this);
  if (!this.binding.isValidBinding()) {
    if (this.binding instanceof ProblemFieldBinding) {
      // tolerate some error cases
      if (this.binding.problemId() == ProblemReasons.NotVisible
          || this.binding.problemId() == ProblemReasons.InheritedNameHidesEnclosingName
          || this.binding.problemId() == ProblemReasons.NonStaticReferenceInConstructorInvocation
          || this.binding.problemId() == ProblemReasons.NonStaticReferenceInStaticContext) {
        throw new SelectionNodeFound(this.binding);
      }
      scope.problemReporter().invalidField(this, (FieldBinding) this.binding);
    } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {
      // tolerate some error cases
      if (this.binding.problemId() == ProblemReasons.NotVisible){
        throw new SelectionNodeFound(this.binding);
      }
      scope.problemReporter().invalidType(this, (TypeBinding) this.binding);
    } else {
      scope.problemReporter().unresolvableReference(this, this.binding);
    }
    throw new SelectionNodeFound();
  }
  throw new SelectionNodeFound(this.binding);
}
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public TypeBinding resolveType(BlockScope scope) {
  // it can be a package, type, member type, local variable or field
  this.binding = scope.getBinding(this.tokens, this);
  if (!this.binding.isValidBinding()) {
    if (this.binding instanceof ProblemFieldBinding) {
      // tolerate some error cases
      if (this.binding.problemId() == ProblemReasons.NotVisible
          || this.binding.problemId() == ProblemReasons.InheritedNameHidesEnclosingName
          || this.binding.problemId() == ProblemReasons.NonStaticReferenceInConstructorInvocation
          || this.binding.problemId() == ProblemReasons.NonStaticReferenceInStaticContext) {
        throw new SelectionNodeFound(this.binding);
      }
      scope.problemReporter().invalidField(this, (FieldBinding) this.binding);
    } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {
      // tolerate some error cases
      if (this.binding.problemId() == ProblemReasons.NotVisible){
        throw new SelectionNodeFound(this.binding);
      }
      scope.problemReporter().invalidType(this, (TypeBinding) this.binding);
    } else {
      scope.problemReporter().unresolvableReference(this, this.binding);
    }
    throw new SelectionNodeFound();
  }
  throw new SelectionNodeFound(this.binding);
}
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public TypeBinding resolveType(BlockScope scope) {
  // it can be a package, type, member type, local variable or field
  this.binding = scope.getBinding(this.tokens, this);
  if (!this.binding.isValidBinding()) {
    if (this.binding instanceof ProblemFieldBinding) {
      // tolerate some error cases
      if (this.binding.problemId() == ProblemReasons.NotVisible
          || this.binding.problemId() == ProblemReasons.InheritedNameHidesEnclosingName
          || this.binding.problemId() == ProblemReasons.NonStaticReferenceInConstructorInvocation
          || this.binding.problemId() == ProblemReasons.NonStaticReferenceInStaticContext) {
        throw new SelectionNodeFound(this.binding);
      }
      scope.problemReporter().invalidField(this, (FieldBinding) this.binding);
    } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {
      // tolerate some error cases
      if (this.binding.problemId() == ProblemReasons.NotVisible){
        throw new SelectionNodeFound(this.binding);
      }
      scope.problemReporter().invalidType(this, (TypeBinding) this.binding);
    } else {
      scope.problemReporter().unresolvableReference(this, this.binding);
    }
    throw new SelectionNodeFound();
  }
  throw new SelectionNodeFound(this.binding);
}
}

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

public TypeBinding resolveType(BlockScope scope) {
  // it can be a package, type, member type, local variable or field
  this.binding = scope.getBinding(this.tokens, this);
  if (!this.binding.isValidBinding()) {
    if (this.binding instanceof ProblemFieldBinding) {
      // tolerate some error cases
      if (this.binding.problemId() == ProblemReasons.NotVisible
          || this.binding.problemId() == ProblemReasons.InheritedNameHidesEnclosingName
          || this.binding.problemId() == ProblemReasons.NonStaticReferenceInConstructorInvocation
          || this.binding.problemId() == ProblemReasons.NonStaticReferenceInStaticContext) {
        throw new SelectionNodeFound(this.binding);
      }
      scope.problemReporter().invalidField(this, (FieldBinding) this.binding);
    } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {
      // tolerate some error cases
      if (this.binding.problemId() == ProblemReasons.NotVisible){
        throw new SelectionNodeFound(this.binding);
      }
      scope.problemReporter().invalidType(this, (TypeBinding) this.binding);
    } else {
      scope.problemReporter().unresolvableReference(this, this.binding);
    }
    throw new SelectionNodeFound();
  }
  throw new SelectionNodeFound(this.binding);
}
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

this.binding = scope.getBinding(this.token, Binding.VARIABLE | Binding.TYPE | Binding.PACKAGE, this, true /*resolve*/);
if (!this.binding.isValidBinding()) {
  if (this.binding instanceof ProblemFieldBinding) {

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

this.binding = scope.getBinding(this.token, Binding.VARIABLE | Binding.TYPE | Binding.PACKAGE, this, true /*resolve*/);
if (!this.binding.isValidBinding()) {
  if (this.binding instanceof ProblemFieldBinding) {

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

this.binding = scope.getBinding(this.token, Binding.VARIABLE | Binding.TYPE | Binding.PACKAGE, this, true /*resolve*/);
if (!this.binding.isValidBinding()) {
  if (this.binding instanceof ProblemFieldBinding) {

相关文章

微信公众号

最新文章

更多

BlockScope类方法