当前位置: 首页>>代码示例>>Java>>正文


Java Opcodes.TABLESWITCH属性代码示例

本文整理汇总了Java中scouter.org.objectweb.asm.Opcodes.TABLESWITCH属性的典型用法代码示例。如果您正苦于以下问题:Java Opcodes.TABLESWITCH属性的具体用法?Java Opcodes.TABLESWITCH怎么用?Java Opcodes.TABLESWITCH使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在scouter.org.objectweb.asm.Opcodes的用法示例。


在下文中一共展示了Opcodes.TABLESWITCH属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitTableSwitchInsn

@Override
public final void visitTableSwitchInsn(final int min, final int max,
        final Label dflt, final Label... labels) {
    AttributesImpl attrs = new AttributesImpl();
    attrs.addAttribute("", "min", "min", "", Integer.toString(min));
    attrs.addAttribute("", "max", "max", "", Integer.toString(max));
    attrs.addAttribute("", "dflt", "dflt", "", getLabel(dflt));
    String o = Printer.OPCODES[Opcodes.TABLESWITCH];
    sa.addStart(o, attrs);
    for (int i = 0; i < labels.length; i++) {
        AttributesImpl att2 = new AttributesImpl();
        att2.addAttribute("", "name", "name", "", getLabel(labels[i]));
        sa.addElement("label", att2);
    }
    sa.addEnd(o);
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:16,代码来源:SAXCodeAdapter.java

示例2: TableSwitchInsnNode

/**
 * Constructs a new {@link TableSwitchInsnNode}.
 * 
 * @param min
 *            the minimum key value.
 * @param max
 *            the maximum key value.
 * @param dflt
 *            beginning of the default handler block.
 * @param labels
 *            beginnings of the handler blocks. <tt>labels[i]</tt> is the
 *            beginning of the handler block for the <tt>min + i</tt> key.
 */
public TableSwitchInsnNode(final int min, final int max,
        final LabelNode dflt, final LabelNode... labels) {
    super(Opcodes.TABLESWITCH);
    this.min = min;
    this.max = max;
    this.dflt = dflt;
    this.labels = new ArrayList<LabelNode>();
    if (labels != null) {
        this.labels.addAll(Arrays.asList(labels));
    }
}
 
开发者ID:scouter-project,项目名称:bytescope,代码行数:24,代码来源:TableSwitchInsnNode.java


注:本文中的scouter.org.objectweb.asm.Opcodes.TABLESWITCH属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。