本文整理汇总了Java中org.objectweb.asm.Opcodes.TABLESWITCH属性的典型用法代码示例。如果您正苦于以下问题:Java Opcodes.TABLESWITCH属性的具体用法?Java Opcodes.TABLESWITCH怎么用?Java Opcodes.TABLESWITCH使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.objectweb.asm.Opcodes
的用法示例。
在下文中一共展示了Opcodes.TABLESWITCH属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: isSwitch
private static boolean isSwitch(AbstractInsnNode insn) {
return Opcodes.TABLESWITCH == insn.getOpcode() || insn.getOpcode() == Opcodes.LOOKUPSWITCH;
}
示例3: 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));
}
}