Package org.objectweb.asm

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


    static byte[] gen_fun_class_data(int arity) {

        String self_type = EFUN_TYPE.getInternalName() + arity;

        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES|ClassWriter.COMPUTE_MAXS);
        cw.visit(Opcodes.V1_6, Opcodes.ACC_PUBLIC | Opcodes.ACC_ABSTRACT,
                self_type, null, EFUN_TYPE.getInternalName(), null);

        make_invoke_method(cw, self_type, arity);

        CompilerVisitor.make_invoketail_method(cw, self_type, arity, 0);
View Full Code Here


                    // .append(safe_module).append(safe_function)
                    .append("Handler").append(arity).toString();

            ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES|ClassWriter.COMPUTE_MAXS);
            String super_class_name = EFUN_TYPE.getInternalName() + arity;
            cw.visit(Opcodes.V1_4, ACC_PUBLIC, self_type, null,
                    super_class_name, null);

            // create handler field
            cw.visitField(ACC_PRIVATE, "handler", EFUNHANDLER_TYPE.getDescriptor(), null, null)
                    .visitEnd();
View Full Code Here

        ensure(arity); // Ensure presence of superclass.
        String super_type = EFUN_TYPE.getInternalName() + arity;
        String self_type = super_type + "Exported";

        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES|ClassWriter.COMPUTE_MAXS);
        cw.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC | Opcodes.ACC_ABSTRACT,
                self_type, null, super_type, null);

        cw.visitField(ACC_PROTECTED | ACC_FINAL, "module_name",
                EATOM_TYPE.getDescriptor(), null, null)
                .visitEnd();
View Full Code Here

        ensure(arity); // Ensure presence of superclass.
        String super_type = EFUN_TYPE.getInternalName() + arity;
        String self_type = super_type + "Guard";

        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES|ClassWriter.COMPUTE_MAXS);
        cw.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC | Opcodes.ACC_ABSTRACT,
                self_type, null, super_type, null);

        // TODO: Factor out default-constructor creation.
        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC/*PROTECTED*/, "<init>", "()V", null, null);
        mv.visitCode();
View Full Code Here

            wrapperPart.setTypeClass(def);
            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

          className = "$" + className;
        }

        Method[] methods = spec.getMethods(); // Method to delegate

        cw.visit(Opcodes.V1_3, Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, className, null, parent, itfs);
        addDependencyField(cw);

        // We try to call super() on the parent, however this should not be used as proxing does work only for interface.
        generateConstructor(cw, className, parent);
View Full Code Here

           
            ClassWriter cw = new ClassWriter(false);

            // Generate the interface
            interfaceName = interfaceName.replace('.', '/');
            cw.visit(V1_5, ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE, interfaceName, null, "java/lang/Object", EMPTY_STRINGS);

            // Generate methods from the WSDL operations
            for (Operation operation : (List<Operation>) portType.getOperations()) {
               
                //FIXME Workaround for TUSCANY-170, we will need to make this consistent with the algorithm used by Axis2 WSDL2Java
View Full Code Here

    ClassWriter cw = new ClassWriter(0);
    FieldVisitor fv;
    MethodVisitor mv;
    AnnotationVisitor av0;
   
    cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER, "RProgram", null, "java/lang/Object", new String[] { });
   
    writeConstructor(cw);
    writeMainMethod(cw);
   
  }
View Full Code Here


  public static byte[] compile(String packageName, Environment packageEnvironment) {

    ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
    cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER, CompiledNames.loaderClassName(packageName), null,
        "java/lang/Object", new String[] { "org/renjin/compiler/runtime/PackageLoader" });

    writeInit(cw);
    writeLoadMethod(cw, packageName, packageEnvironment);
   
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.