org.objectweb.asm.tree.FieldNode.check()方法的使用及代码示例

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

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

FieldNode.check介绍

[英]Checks that this field node is compatible with the given ASM API version. This methods checks that this node, and all its nodes recursively, do not contain elements that were introduced in more recent versions of the ASM API than the given version.
[中]检查此字段节点是否与给定的ASM API版本兼容。此方法检查此节点及其所有递归节点是否不包含比给定版本更新版本的ASM API中引入的元素。

代码示例

代码示例来源:origin: org.ow2.asm/asm-debug-all

/**
 * Checks that this class node is compatible with the given ASM API version.
 * This methods checks that this node, and all its nodes recursively, do not
 * contain elements that were introduced in more recent versions of the ASM
 * API than the given version.
 * 
 * @param api
 *            an ASM API version. Must be one of {@link Opcodes#ASM4} or
 *            {@link Opcodes#ASM5}.
 */
public void check(final int api) {
  if (api == Opcodes.ASM4) {
    if (visibleTypeAnnotations != null
        && visibleTypeAnnotations.size() > 0) {
      throw new RuntimeException();
    }
    if (invisibleTypeAnnotations != null
        && invisibleTypeAnnotations.size() > 0) {
      throw new RuntimeException();
    }
    for (FieldNode f : fields) {
      f.check(api);
    }
    for (MethodNode m : methods) {
      m.check(api);
    }
  }
}

代码示例来源:origin: org.ow2.asm/asm-tree

fields.get(i).check(api);

相关文章

微信公众号

最新文章

更多