Package org.objectweb.asm

Examples of org.objectweb.asm.CodeVisitor.visitMethodInsn()


        Constants.INVOKEVIRTUAL,
        "java/lang/StringBuffer",
        "append",
        "(Ljava/lang/String;)Ljava/lang/StringBuffer;");
    }
    c.visitMethodInsn(Constants.INVOKEVIRTUAL, "java/lang/StringBuffer", "toString", "()Ljava/lang/String;");
    c.visitInsn(Constants.ARETURN);
    c.visitMaxs(1, 1);
   
    return cw;
  }
View Full Code Here


        for (SpeedoCallback actualcbn : cbl) {
          if (actualcbn.listenerClassName == null) { // this a callback from the persistent class
            // CALL THE CALLBACK METHOD INTO THE PERSISTENT CLASS
               mv.visitVarInsn(ALOAD, 2);
               mv.visitTypeInsn(CHECKCAST, gc.xJCN);
               mv.visitMethodInsn(INVOKEVIRTUAL, gc.xJCN,
                   actualcbn.callbackName,
                   actualcbn.methodByteCodeSignature);
          } else { // this is a callback from the listener class
            if (listenclass == null) {
              listenclass = actualcbn.listenerClassName;
View Full Code Here

                final String[] interfaces,
                final String sourceFile) {
            super.cv.visit(version, access, name, supername, interfaces, sourceFile);
            CodeVisitor mv = cv.visitMethod(Constants.ACC_PUBLIC, "<init>", "()V", null, null);
            mv.visitVarInsn(Constants.ALOAD, 0);
            mv.visitMethodInsn(Constants.INVOKESPECIAL, gc.getSuperName(), "<init>", "()V");
            mv.visitInsn(Constants.RETURN);
            mv.visitMaxs(1, 1);
        }
    }
}
View Full Code Here

                final String[] interfaces,
                final String sourceFile) {
            super.cv.visit(version, access, name, supername, interfaces, sourceFile);
            CodeVisitor mv = cv.visitMethod(Constants.ACC_PUBLIC, "<init>", "()V", null, null);
            mv.visitVarInsn(Constants.ALOAD, 0);
            mv.visitMethodInsn(Constants.INVOKESPECIAL, gc.getSuperName(), "<init>", "()V");
            mv.visitInsn(Constants.RETURN);
            mv.visitMaxs(1, 1);
        }
    }
}
View Full Code Here

        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, classToWrite, ISACTIVE_FIELD_NAME, "Z");
        Label l1 = new Label();
        mv.visitJumpInsn(IFEQ, l1);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, "speedoGetHome",
                "()" + JT_HOME);
        mv.visitMethodInsn(INVOKEINTERFACE, JCN_HOME, "getPOManagerFactory",
                "()" + JT_POMF);
        mv.visitMethodInsn(INVOKEINTERFACE, JCN_POMF, "lookup", "()" + JT_POM);
        Label l2 = new Label();
View Full Code Here

        Label l1 = new Label();
        mv.visitJumpInsn(IFEQ, l1);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, "speedoGetHome",
                "()" + JT_HOME);
        mv.visitMethodInsn(INVOKEINTERFACE, JCN_HOME, "getPOManagerFactory",
                "()" + JT_POMF);
        mv.visitMethodInsn(INVOKEINTERFACE, JCN_POMF, "lookup", "()" + JT_POM);
        Label l2 = new Label();
        mv.visitJumpInsn(GOTO, l2);
        mv.visitLabel(l1);
View Full Code Here

                cv.visitMethodInsn(INVOKEVIRTUAL, sqJCN, "setResultClass", "(Ljava/lang/String;)V");
            }
           
            cv.visitVarInsn(ALOAD, 1);
            cv.visitInsn(q.includeSubclasses ? ICONST_1 : ICONST_0);
            cv.visitMethodInsn(INVOKEVIRTUAL, sqJCN, "setIncludeSubClasses", "(Z)V");
           
            //addNamedQuery("${nq.name}", sq);
            cv.visitVarInsn(ALOAD, 0);
            cv.visitLdcInsn(q.name);
            cv.visitVarInsn(ALOAD, 1);
View Full Code Here

        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, "speedoGetHome",
                "()" + JT_HOME);
        mv.visitMethodInsn(INVOKEINTERFACE, JCN_HOME, "getPOManagerFactory",
                "()" + JT_POMF);
        mv.visitMethodInsn(INVOKEINTERFACE, JCN_POMF, "lookup", "()" + JT_POM);
        Label l2 = new Label();
        mv.visitJumpInsn(GOTO, l2);
        mv.visitLabel(l1);
        mv.visitInsn(ACONST_NULL);
        mv.visitLabel(l2);
View Full Code Here

           
            //addNamedQuery("${nq.name}", sq);
            cv.visitVarInsn(ALOAD, 0);
            cv.visitLdcInsn(q.name);
            cv.visitVarInsn(ALOAD, 1);
            cv.visitMethodInsn(INVOKEVIRTUAL, gc.classToWriteJCN,
                    "addNamedQuery", "(Ljava/lang/String;L" + sqJCN + ";)V");
        }
        cv.visitInsn(RETURN);
        cv.visitMaxs(0, 0);
    }
View Full Code Here

    }
    private void generateJdoGetObjectIdMethod() {
        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "jdoGetObjectId",
                "()Ljava/lang/Object;", null, null);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite,
                "getPName", "()Lorg/objectweb/jorm/naming/api/PName;");
        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
    }
    private void generateJdoGetTransactionalObjectIdMethod() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.