org.jf.dexlib2.iface.Annotation.getVisibility()方法的使用及代码示例

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

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

Annotation.getVisibility介绍

[英]Gets the visibility of this annotation. This will be one of the AnnotationVisibility.* constants.
[中]

代码示例

代码示例来源:origin: Sable/soot

protected void addAnnotation(String classType, List<Tag> tags, VisibilityAnnotationTag[] vatg, Annotation a) {
 int v = getVisibility(a.getVisibility());

代码示例来源:origin: testwhat/SmaliEx

@Override public int getVisibility() {
  return annotation.getVisibility();
}

代码示例来源:origin: org.smali/dexlib2

@Nonnull public BuilderAnnotation internAnnotation(@Nonnull Annotation annotation) {
  BuilderAnnotation ret = internedItems.get(annotation);
  if (ret != null) {
    return ret;
  }
  BuilderAnnotation dexBuilderAnnotation = new BuilderAnnotation(
      annotation.getVisibility(),
      dexBuilder.typeSection.internType(annotation.getType()),
      dexBuilder.internAnnotationElements(annotation.getElements()));
  ret = internedItems.putIfAbsent(dexBuilderAnnotation, dexBuilderAnnotation);
  return ret==null?dexBuilderAnnotation:ret;
}

代码示例来源:origin: testwhat/SmaliEx

@Nonnull public BuilderAnnotation internAnnotation(@Nonnull Annotation annotation) {
  BuilderAnnotation ret = internedItems.get(annotation);
  if (ret != null) {
    return ret;
  }
  BuilderAnnotation dexBuilderAnnotation = new BuilderAnnotation(
      annotation.getVisibility(),
      dexBuilder.typeSection.internType(annotation.getType()),
      dexBuilder.internAnnotationElements(annotation.getElements()));
  ret = internedItems.putIfAbsent(dexBuilderAnnotation, dexBuilderAnnotation);
  return ret==null?dexBuilderAnnotation:ret;
}

代码示例来源:origin: KB5201314/ZjDroid

@Nonnull public BuilderAnnotation internAnnotation(@Nonnull Annotation annotation) {
  BuilderAnnotation ret = internedItems.get(annotation);
  if (ret != null) {
    return ret;
  }
  BuilderAnnotation dexBuilderAnnotation = new BuilderAnnotation(
      annotation.getVisibility(),
      context.typePool.internType(annotation.getType()),
      context.internAnnotationElements(annotation.getElements()));
  ret = internedItems.putIfAbsent(dexBuilderAnnotation, dexBuilderAnnotation);
  return ret==null?dexBuilderAnnotation:ret;
}

代码示例来源:origin: com.ibm.wala/com.ibm.wala.dalvik

List<Annotation> getAnnotations(Method m, Set<String> set) {
  List<Annotation> result = new ArrayList<>();
  for(org.jf.dexlib2.iface.Annotation a : m.getAnnotations()) {
    if (set == null || set.contains(AnnotationVisibility.getVisibility(a.getVisibility()))) {
      result.add(DexUtil.getAnnotation(a, getClassLoader().getReference()));
    }
  }
  return result;
}

代码示例来源:origin: wala/WALA

List<Annotation> getAnnotations(Method m, Set<String> set) {
  List<Annotation> result = new ArrayList<>();
  for(org.jf.dexlib2.iface.Annotation a : m.getAnnotations()) {
    if (set == null || set.contains(AnnotationVisibility.getVisibility(a.getVisibility()))) {
      result.add(DexUtil.getAnnotation(a, getClassLoader().getReference()));
    }
  }
  return result;
}

代码示例来源:origin: testwhat/SmaliEx

public static ImmutableAnnotation of(Annotation annotation) {
  if (annotation instanceof  ImmutableAnnotation) {
    return (ImmutableAnnotation)annotation;
  }
  return new ImmutableAnnotation(
      annotation.getVisibility(),
      annotation.getType(),
      annotation.getElements());
}

代码示例来源:origin: org.smali/dexlib2

public static ImmutableAnnotation of(Annotation annotation) {
  if (annotation instanceof  ImmutableAnnotation) {
    return (ImmutableAnnotation)annotation;
  }
  return new ImmutableAnnotation(
      annotation.getVisibility(),
      annotation.getType(),
      annotation.getElements());
}

代码示例来源:origin: org.smali/dexlib2

@Override
public boolean equals(Object o) {
  if (o instanceof Annotation) {
    Annotation other = (Annotation)o;
    return (getVisibility() == other.getVisibility()) &&
        getType().equals(other.getType()) &&
        getElements().equals(other.getElements());
  }
  return false;
}

代码示例来源:origin: KB5201314/ZjDroid

@Override
public boolean equals(Object o) {
  if (o instanceof Annotation) {
    Annotation other = (Annotation)o;
    return (getVisibility() == other.getVisibility()) &&
        getType().equals(other.getType()) &&
        getElements().equals(other.getElements());
  }
  return false;
}

代码示例来源:origin: testwhat/SmaliEx

@Override
public boolean equals(Object o) {
  if (o instanceof Annotation) {
    Annotation other = (Annotation)o;
    return (getVisibility() == other.getVisibility()) &&
        getType().equals(other.getType()) &&
        getElements().equals(other.getElements());
  }
  return false;
}

代码示例来源:origin: wala/WALA

Collection<Annotation> getAnnotations(Set<String> types) {
  Set<Annotation> result = HashSetFactory.make();
  for(org.jf.dexlib2.iface.Annotation a : classDef.getAnnotations()) {
    if (types == null || types.contains(AnnotationVisibility.getVisibility(a.getVisibility()))) {
      result.add(DexUtil.getAnnotation(a, getClassLoader().getReference()));
    }
  }
  return result;
}

代码示例来源:origin: com.ibm.wala/com.ibm.wala.dalvik

Collection<Annotation> getAnnotations(Set<String> types) {
  Set<Annotation> result = HashSetFactory.make();
  for(org.jf.dexlib2.iface.Annotation a : classDef.getAnnotations()) {
    if (types == null || types.contains(AnnotationVisibility.getVisibility(a.getVisibility()))) {
      result.add(DexUtil.getAnnotation(a, getClassLoader().getReference()));
    }
  }
  return result;
}

代码示例来源:origin: testwhat/SmaliEx

public static void writeTo(@Nonnull IndentingWriter writer, @Nonnull Annotation annotation,
                @Nullable String containingClass) throws IOException {
    writer.write(".annotation ");
    writer.write(AnnotationVisibility.getVisibility(annotation.getVisibility()));
    writer.write(' ');
    writer.write(annotation.getType());
    writer.write('\n');

    AnnotationEncodedValueAdaptor.writeElementsTo(writer, annotation.getElements(), containingClass);

    writer.write(".end annotation\n");
  }
}

代码示例来源:origin: org.smali/baksmali

public static void writeTo(@Nonnull IndentingWriter writer, @Nonnull Annotation annotation,
                @Nullable String containingClass) throws IOException {
    writer.write(".annotation ");
    writer.write(AnnotationVisibility.getVisibility(annotation.getVisibility()));
    writer.write(' ');
    writer.write(annotation.getType());
    writer.write('\n');

    AnnotationEncodedValueAdaptor.writeElementsTo(writer, annotation.getElements(), containingClass);

    writer.write(".end annotation\n");
  }
}

代码示例来源:origin: com.taobao.android/dex_patch

public static void writeTo(@Nonnull IndentingWriter writer, @Nonnull Annotation annotation,
                @Nullable String containingClass) throws IOException {
    writer.write(".annotation ");
    writer.write(AnnotationVisibility.getVisibility(annotation.getVisibility()));
    writer.write(' ');
    writer.write(annotation.getType());
    writer.write('\n');

    AnnotationEncodedValueAdaptor.writeElementsTo(writer, annotation.getElements(), containingClass);

    writer.write(".end annotation\n");
  }
}

代码示例来源:origin: testwhat/SmaliEx

@Override
public int compareTo(Annotation o) {
  int res = Ints.compare(getVisibility(), o.getVisibility());
  if (res != 0) return res;
  res = getType().compareTo(o.getType());
  if (res != 0) return res;
  return CollectionUtils.compareAsSet(getElements(), o.getElements());
}

代码示例来源:origin: org.smali/dexlib2

@Override
public int compareTo(Annotation o) {
  int res = Ints.compare(getVisibility(), o.getVisibility());
  if (res != 0) return res;
  res = getType().compareTo(o.getType());
  if (res != 0) return res;
  return CollectionUtils.compareAsSet(getElements(), o.getElements());
}

代码示例来源:origin: KB5201314/ZjDroid

public static void writeTo(IndentingWriter writer, Annotation annotation) throws IOException {
    writer.write(".annotation ");
    writer.write(AnnotationVisibility.getVisibility(annotation.getVisibility()));
    writer.write(' ');
    writer.write(annotation.getType());
    writer.write('\n');

    AnnotationEncodedValueAdaptor.writeElementsTo(writer, annotation.getElements());

    writer.write(".end annotation\n");
  }
}

相关文章