Example usage for org.objectweb.asm.commons AdviceAdapter visitInsn

List of usage examples for org.objectweb.asm.commons AdviceAdapter visitInsn

Introduction

In this page you can find the example usage for org.objectweb.asm.commons AdviceAdapter visitInsn.

Prototype

@Override
    public void visitInsn(final int opcode) 

Source Link

Usage

From source file:com.axway.jmb.builders.Constructors.java

License:Open Source License

public static void buildDefault(ClassVisitor clazz, String superClassInternalFQName) {
    MethodVisitor mv = clazz.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
    AdviceAdapter constructor = new AdviceAdapter(ASM5, mv, ACC_PUBLIC, "<init>", "()V") {
    };//from  w  w w .j  av a  2  s  . c o  m
    constructor.visitCode();
    constructor.visitMaxs(4, 1);

    callSuperConstructor(constructor, superClassInternalFQName);

    constructor.visitInsn(RETURN);
    constructor.visitEnd();
}

From source file:com.axway.jmb.builders.Constructors.java

License:Open Source License

public static void endDefault(AdviceAdapter constructor, int maxStacks, int maxLocals) {
    constructor.visitInsn(RETURN);
    constructor.visitMaxs(maxStacks, maxLocals);
    constructor.visitEnd();/*  www. j a  v a  2 s.  c om*/
}

From source file:com.axway.jmb.builders.Constructors.java

License:Open Source License

private static void callSuperConstructor(AdviceAdapter constructor, String superClassInternalFQName) {

    constructor.visitVarInsn(ALOAD, 0);//from  w w w  . jav a2s  .  co m
    constructor.visitInsn(DUP);
    constructor.visitMethodInsn(INVOKESPECIAL, superClassInternalFQName, "<init>", "()V", false);

}

From source file:com.axway.jmb.builders.Constructors.java

License:Open Source License

public static void endStatic(AdviceAdapter constructor, int maxStacks, int maxLocals) {
    constructor.visitInsn(RETURN);
    constructor.visitMaxs(maxStacks, maxLocals);
    constructor.visitEnd();/*from www  .j a  va  2 s .c  o  m*/
}