Example usage for org.objectweb.asm.tree InsnList add

List of usage examples for org.objectweb.asm.tree InsnList add

Introduction

In this page you can find the example usage for org.objectweb.asm.tree InsnList add.

Prototype

public void add(final InsnList insnList) 

Source Link

Document

Adds the given instructions to the end of this list.

Usage

From source file:org.coldswap.util.AutoBoxing.java

License:Open Source License

private static InsnList boxBoolean() {
    InsnList il = new InsnList();
    il.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "java/lang/Boolean", "valueOf", "(Z)Ljava/lang/Boolean;"));
    return il;//from www.j  a  v  a2 s.com
}

From source file:org.coldswap.util.AutoBoxing.java

License:Open Source License

private static InsnList unboxBoolean() {
    InsnList il = new InsnList();
    il.add(new TypeInsnNode(Opcodes.CHECKCAST, "java/lang/Boolean"));
    il.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "java/lang/Boolean", "booleanValue", "()Z"));
    return il;/*from   ww  w.  j ava 2  s . c om*/
}

From source file:org.coldswap.util.AutoBoxing.java

License:Open Source License

private static InsnList boxByte() {
    InsnList il = new InsnList();
    il.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "java/lang/Byte", "valueOf", "(B)Ljava/lang/Byte;"));
    return il;/*from  ww w  .j  a v a  2 s  .  com*/
}

From source file:org.coldswap.util.AutoBoxing.java

License:Open Source License

private static InsnList unboxByte() {
    InsnList il = new InsnList();
    il.add(new TypeInsnNode(Opcodes.CHECKCAST, "java/lang/Number"));
    il.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "java/lang/Number", "byteValue", "()B"));
    return il;// w w  w  . ja  va2 s .  com
}

From source file:org.coldswap.util.AutoBoxing.java

License:Open Source License

private static InsnList boxChar() {
    InsnList il = new InsnList();
    il.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "java/lang/Character", "valueOf",
            "(C)Ljava/lang/Character;"));
    return il;/* ww w.j  a v a 2s  .  c o m*/
}

From source file:org.coldswap.util.AutoBoxing.java

License:Open Source License

private static InsnList unboxChar() {
    InsnList il = new InsnList();
    il.add(new TypeInsnNode(Opcodes.CHECKCAST, "java/lang/Character"));
    il.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "java/lang/Character", "charValue", "()C"));
    return il;/*from  w ww  .  j a v  a 2  s.  com*/
}

From source file:org.coldswap.util.AutoBoxing.java

License:Open Source License

private static InsnList boxShort() {
    InsnList il = new InsnList();
    il.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "java/lang/Short", "valueOf", "(S)Ljava/lang/Short;"));
    return il;/*  w ww.  j  a va2 s  .  co m*/
}

From source file:org.coldswap.util.AutoBoxing.java

License:Open Source License

private static InsnList unboxShort() {
    InsnList il = new InsnList();
    il.add(new TypeInsnNode(Opcodes.CHECKCAST, "java/lang/Number"));
    il.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "java/lang/Number", "shortValue", "()S"));
    return il;/*from  w w  w .j av a  2 s  .c  o  m*/
}

From source file:org.coldswap.util.AutoBoxing.java

License:Open Source License

private static InsnList boxInt() {
    InsnList il = new InsnList();
    il.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;"));
    return il;//w  ww  . j  av  a  2s . com
}

From source file:org.coldswap.util.AutoBoxing.java

License:Open Source License

private static InsnList unboxInt() {
    InsnList il = new InsnList();
    il.add(new TypeInsnNode(Opcodes.CHECKCAST, "java/lang/Number"));
    il.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "java/lang/Number", "intValue", "()I"));
    return il;/* w  w  w.j a  v a2s. c om*/
}