Package org.objectweb.asm

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


        ClassWriter cw = new ClassWriter(true);
        MethodVisitor mv;

        cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, "jci/Simple", null, "java/lang/Object", null);

        cw.visitSource("Simple.java", null);

        {
            mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
            mv.visitCode();
            Label l0 = new Label();
View Full Code Here


        ClassWriter cw = new ClassWriter(true);
        MethodVisitor mv;

        cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, "jci/Extended", null, "jci/Simple", null);

        cw.visitSource("Extended.java", null);

        {
            mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
            mv.visitCode();
            Label l0 = new Label();
View Full Code Here

        cw.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER,
                 "org/apache/cxf/binding/corba/utils/FixedAnyImpl",
                 null, "com/sun/corba/se/impl/corba/AnyImpl", null);

        cw.visitSource("FixedAnyImpl.java", null);

        fv = cw.visitField(0, "obj", "Lorg/omg/CORBA/portable/Streamable;", null, null);
        fv.visitEnd();
        addFixedAnyConstructor(cw);
        addInsertOverride(cw);
View Full Code Here

        MethodVisitor mv;

        cw.visit(Opcodes.V1_6, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER,
                 ASMHelper.periodToSlashes(newClassName), null, "java/lang/Object", null);

        cw.visitSource(cls.getSimpleName() + "Factory" + ".java", null);

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

  public static byte[] compileNode(String name, AbstractTreeNode root)
      throws Exception {
    ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
    cw.visit(Opcodes.V1_6, ACC_PUBLIC + ACC_FINAL, name, null,
        Type.getInternalName(AbstractTreeNode.class), null);
    cw.visitSource(name + ".java", null);

    // add the constructor
    {
      MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()"
          + Type.VOID_TYPE.getDescriptor(), null, null);
View Full Code Here

        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
        String superClass = internalClassName(OptimizedValueInstantiator.class.getName());
        String generatedClass = internalClassName(srcName);

        cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER + ACC_FINAL, generatedClass, null, superClass, null);
        cw.visitSource(srcName + ".java", null);

        // First: must define 2 constructors:
        // (a) default constructor, for creating bogus instance (just calls default instance)
        // (b) copy-constructor which takes StdValueInstantiator instance, passes to superclass
        final String optimizedValueInstDesc = Type.getDescriptor(OptimizedValueInstantiator.class);
View Full Code Here

            sw.visitEnd();

            cw.visit(V1_5, ACC_ABSTRACT + ACC_PUBLIC + ACC_SUPER, internalClass, sw.toString(),
                    superName, null);
        }
        cw.visitSource(className + ".java", null);
        BeanBuilder.generateDefaultConstructor(cw, superName);
        cw.visitEnd();
        return cw.toByteArray();
    }
View Full Code Here

        } else {
            superName = implName;
            cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, internalClass, null,
                    implName, null);
        }
        cw.visitSource(className + ".java", null);
        BeanBuilder.generateDefaultConstructor(cw, superName);
        for (POJOProperty prop : _beanProperties.values()) {
            // First: determine type to use; preferably setter (usually more explicit); otherwise getter
            TypeDescription type = prop.selectType(_typeFactory);
            createField(cw, prop, type);
View Full Code Here

      //String classFile = interfaze.getSimpleName().substring(1) + "Wrapper.java";
      ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
     
      cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER, className, null, "logisticspipes/asm/wrapper/AbstractWrapper", new String[] { fieldName });
     
      cw.visitSource(".LP|ASM.dynamic", null);
     
      {
        FieldVisitor fv = cw.visitField(ACC_PRIVATE, "proxy", "L" + fieldName + ";", null, null);
        fv.visitEnd();
      }
View Full Code Here

      //String classFile = interfaze.getSimpleName().substring(1) + "Wrapper.java";
      ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
     
      cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER, className, null, "logisticspipes/asm/wrapper/AbstractSubWrapper", new String[] { fieldName });
     
      cw.visitSource(".LP|ASM.dynamic", null);
     
      {
        FieldVisitor fv = cw.visitField(ACC_PRIVATE, "proxy", "L" + fieldName + ";", null, null);
        fv.visitEnd();
      }
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.