org.eclipse.jdt.internal.compiler.ast.Annotation.hasNullBit()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(12.3k)|赞(0)|评价(0)|浏览(81)

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

Annotation.hasNullBit介绍

暂无

代码示例

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

public static boolean containsNullAnnotation(Annotation[] annotations) {
  if (annotations != null) {
    for (int i = 0; i < annotations.length; i++) {
      if (annotations[i] != null && (annotations[i].hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)))
        return true;
    }
  }
  return false;	
}
public TypeReference[] getTypeReferences() {

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

public static boolean containsNullAnnotation(Annotation[] annotations) {
  if (annotations != null) {
    for (int i = 0; i < annotations.length; i++) {
      if (annotations[i] != null && (annotations[i].hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)))
        return true;
    }
  }
  return false;	
}
public TypeReference[] getTypeReferences() {

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

private Annotation findAnnotation(Annotation[] annotations, int typeBit) {
  if (annotations != null) {
    // should have a @NonNull/@Nullable annotation, search for it:
    int length = annotations.length;
    for (int j=0; j<length; j++) {
      if (annotations[j].hasNullBit(typeBit)) {
        return annotations[j];
      }
    }
  }
  return null;
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=372012

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

private Annotation findAnnotation(Annotation[] annotations, int typeBit) {
  if (annotations != null) {
    // should have a @NonNull/@Nullable annotation, search for it:
    int length = annotations.length;
    for (int j=0; j<length; j++) {
      if (annotations[j].hasNullBit(typeBit)) {
        return annotations[j];
      }
    }
  }
  return null;
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=372012

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

private Annotation findAnnotation(Annotation[] annotations, int typeBit) {
  if (annotations != null) {
    // should have a @NonNull/@Nullable annotation, search for it:
    int length = annotations.length;
    for (int j=0; j<length; j++) {
      if (annotations[j].hasNullBit(typeBit)) {
        return annotations[j];
      }
    }
  }
  return null;
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=372012

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

private Annotation findAnnotation(Annotation[] annotations, int typeBit) {
  if (annotations != null) {
    // should have a @NonNull/@Nullable annotation, search for it:
    int length = annotations.length;
    for (int j = length - 1; j >= 0; j--) {
      if (annotations[j].hasNullBit(typeBit)) {
        return annotations[j];
      }
    }
  }
  return null;
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=372012

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

public static boolean containsNullAnnotation(Annotation[] annotations) {
  if (annotations != null) {
    for (int i = 0; i < annotations.length; i++) {
      if (annotations[i] != null && (annotations[i].hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)))
        return true;
    }
  }
  return false;	
}
public TypeReference[] getTypeReferences() {

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

public static boolean containsNullAnnotation(Annotation[] annotations) {
  if (annotations != null) {
    for (int i = 0; i < annotations.length; i++) {
      if (annotations[i] != null && (annotations[i].hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)))
        return true;
    }
  }
  return false;	
}
public TypeReference[] getTypeReferences() {

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

public static boolean containsNullAnnotation(Annotation[] annotations) {
  if (annotations != null) {
    for (int i = 0; i < annotations.length; i++) {
      if (annotations[i] != null && (annotations[i].hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)))
        return true;
    }
  }
  return false;	
}
public TypeReference[] getTypeReferences() {

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

private Annotation findAnnotation(Annotation[] annotations, int typeBit) {
  if (annotations != null) {
    // should have a @NonNull/@Nullable annotation, search for it:
    int length = annotations.length;
    for (int j=0; j<length; j++) {
      if (annotations[j].hasNullBit(typeBit)) {
        return annotations[j];
      }
    }
  }
  return null;
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=372012

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

/** Retrieve the null annotation that has been translated to the given nullTagBits. */
public Annotation findAnnotation(long nullTagBits) {
  if (this.annotations != null) {
    Annotation[] innerAnnotations = this.annotations[this.annotations.length-1];
    if (innerAnnotations != null) {
      int annBit = nullTagBits == TagBits.AnnotationNonNull ? TypeIds.BitNonNullAnnotation : TypeIds.BitNullableAnnotation;
      for (int i = 0; i < innerAnnotations.length; i++) {
        if (innerAnnotations[i] != null && innerAnnotations[i].hasNullBit(annBit))
          return innerAnnotations[i];
      }
    }
  }
  return null;
}
public boolean hasNullTypeAnnotation(AnnotationPosition position) {

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

/** Retrieve the null annotation that has been translated to the given nullTagBits. */
public Annotation findAnnotation(long nullTagBits) {
  if (this.annotations != null) {
    Annotation[] innerAnnotations = this.annotations[this.annotations.length-1];
    if (innerAnnotations != null) {
      int annBit = nullTagBits == TagBits.AnnotationNonNull ? TypeIds.BitNonNullAnnotation : TypeIds.BitNullableAnnotation;
      for (int i = 0; i < innerAnnotations.length; i++) {
        if (innerAnnotations[i] != null && innerAnnotations[i].hasNullBit(annBit))
          return innerAnnotations[i];
      }
    }
  }
  return null;
}
public boolean hasNullTypeAnnotation(AnnotationPosition position) {

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

/** Retrieve the null annotation that has been translated to the given nullTagBits. */
public Annotation findAnnotation(long nullTagBits) {
  if (this.annotations != null) {
    Annotation[] innerAnnotations = this.annotations[this.annotations.length-1];
    if (innerAnnotations != null) {
      int annBit = nullTagBits == TagBits.AnnotationNonNull ? TypeIds.BitNonNullAnnotation : TypeIds.BitNullableAnnotation;
      for (int i = 0; i < innerAnnotations.length; i++) {
        if (innerAnnotations[i] != null && innerAnnotations[i].hasNullBit(annBit))
          return innerAnnotations[i];
      }
    }
  }
  return null;
}
public boolean hasNullTypeAnnotation(AnnotationPosition position) {

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

/** Retrieve the null annotation that has been translated to the given nullTagBits. */
public Annotation findAnnotation(long nullTagBits) {
  if (this.annotations != null) {
    Annotation[] innerAnnotations = this.annotations[this.annotations.length-1];
    if (innerAnnotations != null) {
      int annBit = nullTagBits == TagBits.AnnotationNonNull ? TypeIds.BitNonNullAnnotation : TypeIds.BitNullableAnnotation;
      for (int i = 0; i < innerAnnotations.length; i++) {
        if (innerAnnotations[i] != null && innerAnnotations[i].hasNullBit(annBit))
          return innerAnnotations[i];
      }
    }
  }
  return null;
}
public boolean hasNullTypeAnnotation(AnnotationPosition position) {

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

/** Retrieve the null annotation that has been translated to the given nullTagBits. */
public Annotation findAnnotation(long nullTagBits) {
  if (this.annotations != null) {
    Annotation[] innerAnnotations = this.annotations[this.annotations.length-1];
    if (innerAnnotations != null) {
      int annBit = nullTagBits == TagBits.AnnotationNonNull ? TypeIds.BitNonNullAnnotation : TypeIds.BitNullableAnnotation;
      for (int i = 0; i < innerAnnotations.length; i++) {
        if (innerAnnotations[i] != null && innerAnnotations[i].hasNullBit(annBit))
          return innerAnnotations[i];
      }
    }
  }
  return null;
}
public boolean hasNullTypeAnnotation(AnnotationPosition position) {

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

public void illegalParameterRedefinition(Argument argument, ReferenceBinding declaringClass, TypeBinding inheritedParameter) {
  int sourceStart = argument.type.sourceStart;
  if (argument.annotations != null) {
    for (int i=0; i<argument.annotations.length; i++) {
      Annotation annotation = argument.annotations[i];
      if (annotation.hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)) {
        sourceStart = annotation.sourceStart;
        break;
      }
    }
  }
  this.handle(
    IProblem.IllegalParameterNullityRedefinition, 
    new String[] { new String(argument.name), new String(declaringClass.readableName()), new String(inheritedParameter.nullAnnotatedReadableName(this.options, false)) },
    new String[] { new String(argument.name), new String(declaringClass.shortReadableName()), new String(inheritedParameter.nullAnnotatedReadableName(this.options, true))  },
    sourceStart,
    argument.type.sourceEnd);
}
public void illegalReturnRedefinition(AbstractMethodDeclaration abstractMethodDecl, MethodBinding inheritedMethod, char[][] nonNullAnnotationName) {

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

public void illegalParameterRedefinition(Argument argument, ReferenceBinding declaringClass, TypeBinding inheritedParameter) {
  int sourceStart = argument.type.sourceStart;
  if (argument.annotations != null) {
    for (int i=0; i<argument.annotations.length; i++) {
      Annotation annotation = argument.annotations[i];
      if (annotation.hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)) {
        sourceStart = annotation.sourceStart;
        break;
      }
    }
  }
  this.handle(
    IProblem.IllegalParameterNullityRedefinition, 
    new String[] { new String(argument.name), new String(declaringClass.readableName()), new String(inheritedParameter.nullAnnotatedReadableName(this.options, false)) },
    new String[] { new String(argument.name), new String(declaringClass.shortReadableName()), new String(inheritedParameter.nullAnnotatedReadableName(this.options, true))  },
    sourceStart,
    argument.type.sourceEnd);
}
public void illegalReturnRedefinition(AbstractMethodDeclaration abstractMethodDecl, MethodBinding inheritedMethod, char[][] nonNullAnnotationName) {

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

public void illegalParameterRedefinition(Argument argument, ReferenceBinding declaringClass, TypeBinding inheritedParameter) {
  int sourceStart = argument.type.sourceStart;
  if (argument.annotations != null) {
    for (int i=0; i<argument.annotations.length; i++) {
      Annotation annotation = argument.annotations[i];
      if (annotation.hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)) {
        sourceStart = annotation.sourceStart;
        break;
      }
    }
  }
  this.handle(
    IProblem.IllegalParameterNullityRedefinition, 
    new String[] { new String(argument.name), new String(declaringClass.readableName()), new String(inheritedParameter.nullAnnotatedReadableName(this.options, false)) },
    new String[] { new String(argument.name), new String(declaringClass.shortReadableName()), new String(inheritedParameter.nullAnnotatedReadableName(this.options, true))  },
    sourceStart,
    argument.type.sourceEnd);
}
public void illegalReturnRedefinition(AbstractMethodDeclaration abstractMethodDecl, MethodBinding inheritedMethod, char[][] nonNullAnnotationName) {

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

public void illegalParameterRedefinition(Argument argument, ReferenceBinding declaringClass, TypeBinding inheritedParameter) {
  int sourceStart = argument.type.sourceStart;
  if (argument.annotations != null) {
    for (int i=0; i<argument.annotations.length; i++) {
      Annotation annotation = argument.annotations[i];
      if (annotation.hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)) {
        sourceStart = annotation.sourceStart;
        break;
      }
    }
  }
  this.handle(
    IProblem.IllegalParameterNullityRedefinition, 
    new String[] { new String(argument.name), new String(declaringClass.readableName()), new String(inheritedParameter.nullAnnotatedReadableName(this.options, false)) },
    new String[] { new String(argument.name), new String(declaringClass.shortReadableName()), new String(inheritedParameter.nullAnnotatedReadableName(this.options, true))  },
    sourceStart,
    argument.type.sourceEnd);
}
public void illegalReturnRedefinition(AbstractMethodDeclaration abstractMethodDecl, MethodBinding inheritedMethod, char[][] nonNullAnnotationName) {

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

public void illegalParameterRedefinition(Argument argument, ReferenceBinding declaringClass, TypeBinding inheritedParameter) {
  int sourceStart = argument.type.sourceStart;
  if (argument.annotations != null) {
    for (int i=0; i<argument.annotations.length; i++) {
      Annotation annotation = argument.annotations[i];
      if (annotation.hasNullBit(TypeIds.BitNonNullAnnotation|TypeIds.BitNullableAnnotation)) {
        sourceStart = annotation.sourceStart;
        break;
      }
    }
  }
  this.handle(
    IProblem.IllegalParameterNullityRedefinition, 
    new String[] { new String(argument.name), new String(declaringClass.readableName()), new String(inheritedParameter.nullAnnotatedReadableName(this.options, false)) },
    new String[] { new String(argument.name), new String(declaringClass.shortReadableName()), new String(inheritedParameter.nullAnnotatedReadableName(this.options, true))  },
    sourceStart,
    argument.type.sourceEnd);
}
public void illegalReturnRedefinition(AbstractMethodDeclaration abstractMethodDecl, MethodBinding inheritedMethod, char[][] nonNullAnnotationName) {

相关文章