Package org.objectweb.asm

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


                wrapperBeans.add(def);
                return;
            }
        }
        String classFileName = periodToSlashes(className);
        cw.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, classFileName, null,
                 "java/lang/Object", null);

        AnnotationVisitor av0 = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlRootElement;", true);
        av0.visit("name", wrapperElement.getLocalPart());
        av0.visit("namespace", wrapperElement.getNamespaceURI());
View Full Code Here


    }

    private void generatePackageInfo(String className, String ns, Class clz) {
        ClassWriter cw = createClassWriter();
        String classFileName = periodToSlashes(className);
        cw.visit(Opcodes.V1_5, Opcodes.ACC_ABSTRACT + Opcodes.ACC_INTERFACE, classFileName, null,
                 "java/lang/Object", null);
       
        boolean q = qualified;
        SchemaInfo si = interfaceInfo.getService().getSchema(ns);
        if (si != null) {
View Full Code Here

                wrapperBeans.add(def);
                return;
            }
        }
        String classFileName = periodToSlashes(className);
        cw.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, classFileName, null,
                 "java/lang/Object", null);

        AnnotationVisitor av0 = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlRootElement;", true);
        av0.visit("name", wrapperElement.getLocalPart());
        av0.visit("namespace", wrapperElement.getNamespaceURI());
View Full Code Here

    }

    private void generatePackageInfo(String className, String ns, Class clz) {
        ClassWriter cw = createClassWriter();
        String classFileName = periodToSlashes(className);
        cw.visit(Opcodes.V1_5, Opcodes.ACC_ABSTRACT + Opcodes.ACC_INTERFACE, classFileName, null,
                 "java/lang/Object", null);
       
        boolean q = qualified;
        SchemaInfo si = interfaceInfo.getService().getSchema(ns);
        if (si != null) {
View Full Code Here

            record.returnType = method.getReturnType();
            record.parameters = method.getNativeParameterTypes();
            record.className  = className;

            ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
            cw.visit(V1_3,ACC_PUBLIC, className,null,"org/codehaus/groovy/reflection/GeneratedMetaMethod", null);

            createConstructor(cw);

            final String methodDescriptor = BytecodeHelper.getMethodDescriptor(returnType, method.getNativeParameterTypes());
View Full Code Here

    Writer out = new TemplateWriter(bos, "GBK");

    ClassWriter cw = new ClassWriter(COMPUTE_FRAMES | COMPUTE_MAXS);
    MethodVisitor mw;
    String name = "test";
    cw.visit(V1_5, ACC_PUBLIC, name, null, "java/lang/Object",
        new String[] { IParser.NAME });

    mw = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
    mw.visitVarInsn(ALOAD, THIS);
    mw.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
View Full Code Here

    Writer out = new TemplateWriter(bos, "GBK");

    ClassWriter cw = new ClassWriter(COMPUTE_FRAMES | COMPUTE_MAXS);
    MethodVisitor mw;
    String name = "test";
    cw.visit(V1_5, ACC_PUBLIC, name, null, "java/lang/Object",
        new String[] { IParser.NAME });

    mw = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
    mw.visitVarInsn(ALOAD, THIS);
    mw.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
View Full Code Here

    if (name != null) {
      cw.visitSource(name, null);
    }
    MethodVisitor mw;
    name = "template";
    cw.visit(V1_5, ACC_PUBLIC, name, null, "java/lang/Object", INTERFACES);

    // 定义类的构造方法
    mw = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
    mw.visitVarInsn(ALOAD, THIS);
    mw.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
View Full Code Here

    if (name != null) {
      cw.visitSource(name, null);
    }
    MethodVisitor mw;
    name = "template";
    cw.visit(V1_5, ACC_PUBLIC, name, null, "java/lang/Object", INTERFACES);

    // 定义类的构造方法
    mw = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
    mw.visitVarInsn(ALOAD, THIS);
    mw.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
View Full Code Here

   
    ClassWriter cw = new ClassWriter(true);

    String str = StringReplace.replaceChar(File.separatorChar, '/', className);
   
    cw.visit(Constants.V1_1, Constants.ACC_PUBLIC, //access
    str, //name
    "org/objectweb/speedo/mapper/lib/Object2StringSerializer", //superName
    new String[0], //interfaces
    str // sourcefile
    );
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.