org.eclipse.jdt.internal.compiler.lookup.Binding类的使用及代码示例

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

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

Binding介绍

暂无

代码示例

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

public void nullDefaultAnnotationIsRedundant(ASTNode location, Annotation[] annotations, Binding outer) {
  Annotation annotation = findAnnotation(annotations, TypeIds.BitNonNullByDefaultAnnotation);
  int start = annotation != null ? annotation.sourceStart : location.sourceStart;
  int end = annotation != null ? annotation.sourceEnd : location.sourceStart;
  String[] args = NoArgument;
  String[] shortArgs = NoArgument;
  if (outer != null) {
    args = new String[] { new String(outer.readableName()) };
    shortArgs = new String[] { new String(outer.shortReadableName()) };
  }
  int problemId = IProblem.RedundantNullDefaultAnnotation;
  if (outer instanceof PackageBinding) {
    problemId = IProblem.RedundantNullDefaultAnnotationPackage;
  } else if (outer instanceof ReferenceBinding) {
    problemId = IProblem.RedundantNullDefaultAnnotationType;
  } else if (outer instanceof MethodBinding) {
    problemId = IProblem.RedundantNullDefaultAnnotationMethod;
  }
  this.handle(problemId, args, shortArgs, start, end);
}

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

private void internalResolve(Scope scope, boolean staticContext) {
  // detect variable/type name collisions
  if (this.binding != null) {
    Binding existingType = scope.parent.getBinding(this.name, Binding.TYPE, this, false/*do not resolve hidden field*/);
    if (existingType != null
        && this.binding != existingType
        && existingType.isValidBinding()
        && (existingType.kind() != Binding.TYPE_PARAMETER || !staticContext)) {
      scope.problemReporter().typeHiding(this, existingType);
    }
  }
}

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

@Override
public boolean isDeprecated(Element e) {
  if (!(e instanceof ElementImpl)) {
    return false;
  }
  return (((ElementImpl)e)._binding.getAnnotationTagBits() & TagBits.AnnotationDeprecated) != 0;
}

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

switch (recipient.kind()) {
  case Binding.LOCAL:
    recipientTargetMask = recipient.isParameter() ? TagBits.AnnotationForParameter : TagBits.AnnotationForLocalVariable;
    break;
  case Binding.FIELD:
    return;
  switch (recipient.kind()) {
    case Binding.LOCAL:
      LocalVariableBinding local = (LocalVariableBinding) recipient;
  AnnotationBinding [] recipientAnnotations = recipient.getAnnotations();
  int length = recipientAnnotations == null ? 0 : recipientAnnotations.length;
  int newLength = 0;
    recipient.setAnnotations(recipientAnnotations, scope);

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

if (left != null && !left.isVolatile() && left == getDirectBinding(this.expression)) {
  scope.problemReporter().assignmentHasNoEffect(this, left.shortReadableName());

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

public char[] shortReadableName(){
  return readableName();
}
public AnnotationBinding[] getAnnotations() {

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

protected TypeBinding getTypeBinding(Scope scope) {
  // it can be a package, type or member type
  Binding binding = scope.parent.getTypeOrPackage(this.tokens); // step up from the ClassScope
  if (!binding.isValidBinding()) {
    scope.problemReporter().invalidType(this, (TypeBinding) binding);

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

    throw new CompletionNodeFound();
  }

  throw new CompletionNodeFound(this, binding, scope);
}
public boolean isClass(){

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

public static boolean isAnnotationTargetAllowed(BlockScope scope, TypeBinding annotationType, Binding recipient) {
  long metaTagBits = annotationType.getAnnotationTagBits(); // could be forward reference
  if ((metaTagBits & TagBits.AnnotationTargetMASK) == 0) {
    return true;
  }
  return isAnnotationTargetAllowed(recipient, scope, annotationType, recipient.kind(), metaTagBits)==AnnotationTargetAllowed.YES;
}

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

@Override
public JavaElement resolved(Binding binding) {
  SourceRefElement resolvedHandle = new ResolvedBinaryMethod(this.parent, this.name, this.parameterTypes, new String(binding.computeUniqueKey()));
  resolvedHandle.occurrenceCount = this.occurrenceCount;
  return resolvedHandle;
}/*
 * @private Debugging purposes

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

@Override
public Name getSimpleName() {
  return new NameImpl(_binding.shortReadableName());
}

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

if (this instanceof NameReference) {
  final Binding receiverBinding = ((NameReference) this).binding;
  if (receiverBinding.isParameter() && (((LocalVariableBinding) receiverBinding).tagBits & TagBits.ForcedToBeRawType) != 0) {
    return true;  // parameter is forced to be raw since super method uses raw types.
  } else if (receiverBinding instanceof FieldBinding) {

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

public static boolean isValid(/*@Nullable*/Binding binding) {
  return binding != null && binding.isValidBinding();
}
public boolean isVolatile() {

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

public final boolean isValidBinding() {
  return problemId() == ProblemReasons.NoError;
}
public boolean isVolatile() {

代码示例来源:origin: com.android.tools.lint/lint

@NonNull
@Override
public Iterable<ResolvedAnnotation> getAnnotations() {
  List<ResolvedAnnotation> all = Lists.newArrayListWithExpectedSize(2);
  AnnotationBinding[] annotations = mBinding.getAnnotations();
  int count = annotations.length;
  if (count == 0) {
    Binding pkgInfo = mBinding.getTypeOrPackage(TypeConstants.PACKAGE_INFO_NAME);
    if (pkgInfo != null) {
      annotations = pkgInfo.getAnnotations();
    }
    count = annotations.length;
  }
  if (count > 0) {
    for (AnnotationBinding annotation : annotations) {
      if (annotation != null) {
        all.add(new EcjResolvedAnnotation(annotation));
      }
    }
  }
  // Merge external annotations
  ExternalAnnotationRepository manager = ExternalAnnotationRepository.get(client);
  Collection<ResolvedAnnotation> external = manager.getAnnotations(this);
  if (external != null) {
    all.addAll(external);
  }
  all = ensureUnique(all);
  return all;
}

代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps

switch (recipient.kind()) {
  case Binding.LOCAL:
    recipientTargetMask = recipient.isParameter() ? TagBits.AnnotationForParameter : TagBits.AnnotationForLocalVariable;
    break;
  case Binding.FIELD:
    return;
  switch (recipient.kind()) {
    case Binding.LOCAL:
      LocalVariableBinding local = (LocalVariableBinding) recipient;
  AnnotationBinding [] recipientAnnotations = recipient.getAnnotations();
  int length = recipientAnnotations == null ? 0 : recipientAnnotations.length;
  int newLength = 0;
    recipient.setAnnotations(recipientAnnotations, scope);

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

if (left != null && !left.isVolatile() && left == getDirectBinding(this.expression)) {
  scope.problemReporter().assignmentHasNoEffect(this, left.shortReadableName());

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

@Override
  public String toString() {
    return new String(_binding.readableName());
  }
}

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

protected TypeBinding getTypeBinding(Scope scope) {
  // it can be a package, type or member type
  Binding binding = scope.parent.getTypeOrPackage(this.tokens); // step up from the ClassScope
  if (!binding.isValidBinding()) {
    scope.problemReporter().invalidType(this, (TypeBinding) binding);

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

    throw new CompletionNodeFound();
  }

  throw new CompletionNodeFound(this, binding, scope);
}
public boolean isClass(){

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

public static boolean isAnnotationTargetAllowed(BlockScope scope, TypeBinding annotationType, Binding recipient) {
  long metaTagBits = annotationType.getAnnotationTagBits(); // could be forward reference
  if ((metaTagBits & TagBits.AnnotationTargetMASK) == 0) {
    return true;
  }
  return isAnnotationTargetAllowed(recipient, scope, annotationType, recipient.kind(), metaTagBits);
}

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

@Override
public JavaElement resolved(Binding binding) {
  SourceRefElement resolvedHandle = new ResolvedSourceField(this.parent, this.name, new String(binding.computeUniqueKey()));
  resolvedHandle.occurrenceCount = this.occurrenceCount;
  return resolvedHandle;
}
/**

相关文章