Examples of visitSource()


Examples of org.apache.xbean.asm5.ClassWriter.visitSource()

            final Class<?> anInterface = interfaces[i];
            interfaceNames[i] = anInterface.getName().replace('.', '/');
        }

        cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, proxyClassFileName, null, classFileName, interfaceNames);
        cw.visitSource(classFileName + ".java", null);

        cw.visitAnnotation("L" + Proxy.class.getName().replace('.', '/') + ";", true).visitEnd();

        // push InvocationHandler fields
        cw.visitField(ACC_FINAL + ACC_PRIVATE, BUSSINESS_HANDLER_NAME, "Ljava/lang/reflect/InvocationHandler;", null, null).visitEnd();
View Full Code Here

Examples of org.apache.xbean.asm5.ClassWriter.visitSource()

        final String proxyClassFileName = getSubclassName(classToProxy).replace('.', '/');
        final String classFileName = classToProxy.getName().replace('.', '/');

        cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, proxyClassFileName, null, classFileName, null);
        cw.visitSource(classFileName + ".java", null);


        // push InvocationHandler field
        cw.visitField(ACC_FINAL + ACC_PRIVATE, "this$handler", "Ljava/lang/reflect/InvocationHandler;", null, null).visitEnd();
View Full Code Here

Examples of org.apache.xbean.asm5.ClassWriter.visitSource()

        final ClassWriter cw = new ClassWriter(0);
        MethodVisitor mv;

        cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, classFilePath, null, "java/lang/Object", new String[]{"org/hibernate/transaction/TransactionManagerLookup"});

        cw.visitSource(sourceFileName, null);

        {
            mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
            mv.visitCode();
            mv.visitVarInsn(ALOAD, 0);
View Full Code Here

Examples of org.apache.xbean.asm5.ClassWriter.visitSource()

        final ClassWriter cw = new ClassWriter(0);
        MethodVisitor mv;

        cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, classFilePath, null, "oracle/toplink/essentials/transaction/JTATransactionController", null);

        cw.visitSource(sourceFileName, null);

        {
            mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
            mv.visitCode();
            mv.visitVarInsn(ALOAD, 0);
View Full Code Here

Examples of org.codehaus.jackson.org.objectweb.asm.ClassWriter.visitSource()

        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
        String superClass = internalClassName(BeanPropertyAccessor.class.getName());
       
        // muchos important: level at least 1.5 to get generics!!!
        cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, generatedClass, null, superClass, null);
        cw.visitSource(srcName + ".java", null);

        // add default (no-arg) constructor:
        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
View Full Code Here

Examples of org.deuce.objectweb.asm.ClassWriter.visitSource()

  public static byte[] getCode(ArrayList<Object> remoteDetails, String className) {
    ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
    String[] iF = {"java/rmi/Remote","java/io/Serializable"};
    cw.visit(V1_6, ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE, className, null, "java/lang/Object",iF);
    cw.visitSource("$HY$_IBankAccount.java", null);
    ProxyInterface.addCode(remoteDetails, cw)
    cw.visitEnd();
    //Test Generated Class
    ClassReader cr3 = new ClassReader(cw.toByteArray());
    ClassWriter cw1 = new ClassWriter(ClassWriter.COMPUTE_MAXS);
View Full Code Here

Examples of org.mvel2.asm.ClassWriter.visitSource()

                                            className,
                                            null,
                                            Type.getInternalName( superClass ),
                                            null );

        cw.visitSource( null,
                        null );

        return cw;
    }
View Full Code Here

Examples of org.objectweb.asm.ClassVisitor.visitSource()

    }

    public void testIllegalClassMemberVisitBeforeStart() {
        ClassVisitor cv = new CheckClassAdapter(new EmptyVisitor());
        try {
            cv.visitSource(null, null);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

Examples of org.objectweb.asm.ClassWriter.visitSource()

        String classname = pkg + "/GeneratedUnsafe";
        String classpath = dir + "/GeneratedUnsafe.class";
       
        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
        cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, classname, null, p(Object.class), new String[] {p(Unsafe.class)});
        cw.visitSource("<generated>", null);
       
        SkinnyMethodAdapter method = new SkinnyMethodAdapter(cw.visitMethod(ACC_PUBLIC, "<init>", sig(void.class), null, null));
        method.start();
        method.aload(0);
        method.invokespecial(p(Object.class), "<init>", sig(void.class));
View Full Code Here

Examples of org.objectweb.asm.ClassWriter.visitSource()

    ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
    int classId = id.incrementAndGet();
    String className = "com.github.mustachejava.codegen.RunCodes" + classId;
    String internalClassName = className.replace(".", "/");
    cw.visit(Opcodes.V1_6, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, internalClassName, null, "java/lang/Object", new String[]{CompiledCodes.class.getName().replace(".", "/")});
    cw.visitSource("runCodes", null);

    GeneratorAdapter cm = new GeneratorAdapter(Opcodes.ACC_PUBLIC, getMethod("void <init> (com.github.mustachejava.Code[])"), null, null, cw);
    cm.loadThis();
    cm.invokeConstructor(Type.getType(Object.class), getMethod("void <init> ()"));
    {
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.