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

x33g5p2x  于2022-01-19 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(137)

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

Field.getAnnotations介绍

[英]Gets a set of the annotations that are applied to this field. The annotations in the returned set are guaranteed to have unique types.
[中]获取应用于此字段的一组批注。返回集中的注释保证具有唯一的类型。

代码示例

代码示例来源:origin: JesusFreke/smali

@Nullable @Override public Set<? extends Annotation> getFieldAnnotations(@Nonnull Field field) {
  Set<? extends Annotation> annotations = field.getAnnotations();
  if (annotations.size() == 0) {
    return null;
  }
  return annotations;
}

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

/**
 * Converts field annotations from Dexlib to Jimple
 *
 * @param h
 * @param f
 */
public void handleFieldAnnotation(Host h, Field f) {
 Set<? extends Annotation> aSet = f.getAnnotations();
 if (aSet != null && !aSet.isEmpty()) {
  List<Tag> tags = handleAnnotation(aSet, null);
  if (tags != null) {
   for (Tag t : tags) {
    if (t != null) {
     h.addTag(t);
    }
   }
  }
 }
}

代码示例来源:origin: Tencent/tinker

field.getAccessFlags(),
    field.getInitialValue(),
    field.getAnnotations()
);
builderFields.add(builderField);

代码示例来源:origin: JesusFreke/smali

dexPool.annotationSetSection.intern(field.getAnnotations());

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

@Nullable @Override public Set<? extends Annotation> getFieldAnnotations(@Nonnull Field field) {
  Set<? extends Annotation> annotations = field.getAnnotations();
  if (annotations.size() == 0) {
    return null;
  }
  return annotations;
}

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

@Nullable @Override public Set<? extends Annotation> getFieldAnnotations(@Nonnull Field field) {
  Set<? extends Annotation> annotations = field.getAnnotations();
  if (annotations.size() == 0) {
    return null;
  }
  return annotations;
}

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

@Nonnull public Set<? extends Annotation> getAnnotations() {
    return RewriterUtils.rewriteSet(rewriters.getAnnotationRewriter(), field.getAnnotations());
  }
}

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

@Nonnull public Set<? extends Annotation> getAnnotations() {
    return RewriterUtils.rewriteSet(rewriters.getAnnotationRewriter(), field.getAnnotations());
  }
}

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

@Nonnull public Set<? extends Annotation> getAnnotations() {
    return RewriterUtils.rewriteSet(rewriters.getAnnotationRewriter(), field.getAnnotations());
  }
}

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

Collection<Annotation> getAnnotations(Field m) {
  List<Annotation> result = new ArrayList<>();
  for(org.jf.dexlib2.iface.Annotation a : m.getAnnotations()) {
    result.add(DexUtil.getAnnotation(a, getClassLoader().getReference()));
  }
  return result;
}

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

Collection<Annotation> getAnnotations(Field m) {
  List<Annotation> result = new ArrayList<>();
  for(org.jf.dexlib2.iface.Annotation a : m.getAnnotations()) {
    result.add(DexUtil.getAnnotation(a, getClassLoader().getReference()));
  }
  return result;
}

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

public static ImmutableField of(Field field) {
  if (field instanceof  ImmutableField) {
    return (ImmutableField)field;
  }
  return new ImmutableField(
      field.getDefiningClass(),
      field.getName(),
      field.getType(),
      field.getAccessFlags(),
      field.getInitialValue(),
      field.getAnnotations());
}

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

public static ImmutableField of(Field field) {
  if (field instanceof  ImmutableField) {
    return (ImmutableField)field;
  }
  return new ImmutableField(
      field.getDefiningClass(),
      field.getName(),
      field.getType(),
      field.getAccessFlags(),
      field.getInitialValue(),
      field.getAnnotations());
}

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

public static ImmutableField of(Field field) {
  if (field instanceof  ImmutableField) {
    return (ImmutableField)field;
  }
  return new ImmutableField(
      field.getDefiningClass(),
      field.getName(),
      field.getType(),
      field.getAccessFlags(),
      field.getInitialValue(),
      field.getAnnotations());
}

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

@Override
protected Field reField(Field field) {
  String name = field.getName();
  String newType;
  boolean isBasic = false;
  boolean isArray = false;
  if (field.getType().startsWith("[")) {
    isArray = true;
  }
  if (basicType.containsKey(field.getType())) {
    newType = field.getType();
    isBasic = true;
  } else {
    newType = DefineUtils.getDalvikClassName(field.getType());
  }
  String defineClass = DefineUtils.getDalvikClassName(field.getDefiningClass());
  return new ImmutableField(
      reType,
      classProcessor.filedProcess(defineClass, isBasic ? basicType.get(newType) : newType + (isArray ? "[]" : ""), name).fieldName,
      isBasic ? newType :
          DefineUtils.getDefineClassName(classProcessor.classProcess(isBasic ? basicType.get(newType) : newType).className, isArray),
      field.getAccessFlags(),
      field.getInitialValue(),
      getAnnotation(field.getAnnotations()));
}

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

annotationSetPool.intern(field.getAnnotations());

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

Collection<? extends Annotation> annotations = field.getAnnotations();
if (annotations.size() > 0) {
  writer.indent(4);

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

Collection<? extends Annotation> annotations = field.getAnnotations();
if (annotations.size() > 0) {
  writer.indent(4);

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

Collection<? extends Annotation> annotations = field.getAnnotations();
if (annotations.size() > 0) {
  writer.indent(4);

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

Collection<? extends Annotation> annotations = field.getAnnotations();
if (annotations.size() > 0) {
  writer.indent(4);

相关文章