Package com.google.gwt.dev.asm

Examples of com.google.gwt.dev.asm.ClassVisitor


   */
  private CollectClassData processClass(CompiledClass compiledClass) {
    byte[] classBytes = compiledClass.getBytes();
    ClassReader reader = new ClassReader(classBytes);
    CollectClassData mcv = new CollectClassData();
    ClassVisitor cv = mcv;
    if (false) {
      cv = new TraceClassVisitor(cv, new PrintWriter(System.out));
    }
    reader.accept(cv, 0);
    return mcv;
View Full Code Here


    String desc = toDescriptor(className);
    assert (!jsoIntfDescs.contains(desc));

    // The ASM model is to chain a bunch of visitors together.
    ClassWriter writer = new ClassWriter(0);
    ClassVisitor v = writer;

    // v = new CheckClassAdapter(v);
    // v = new TraceClassVisitor(v, new PrintWriter(System.out));

    v = new RewriteSingleJsoImplDispatches(v, typeOracle, jsoData);
View Full Code Here

    assert (superDescs != null);
    assert (superDescs.size() > 0);

    // The ASM model is to chain a bunch of visitors together.
    ClassWriter writer = new ClassWriter(0);
    ClassVisitor v = writer;

    // v = new CheckClassAdapter(v);
    // v = new TraceClassVisitor(v, new PrintWriter(System.out));

    String[] interfaces;
    // TODO(bov): something better than linear?
    if (superDescs.contains("java/lang/Object")) {
      interfaces = null;
    } else {
      interfaces = superDescs.toArray(new String[superDescs.size()]);
    }
    v.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC | Opcodes.ACC_INTERFACE, desc,
        null, "java/lang/Object", interfaces);
    v.visitEnd();
    return writer.toByteArray();
  }
View Full Code Here

    String desc = toDescriptor(className);
    assert (!jsoIntfDescs.contains(desc));

    // The ASM model is to chain a bunch of visitors together.
    ClassWriter writer = new ClassWriter(0);
    ClassVisitor v = writer;

    // v = new CheckClassAdapter(v);
    // v = new TraceClassVisitor(v, new PrintWriter(System.out));

    v = new RewriteRefsToJsoClasses(v, jsoIntfDescs, mapper);
View Full Code Here

    String superDesc = jsoSuperDescs.get(desc);
    assert (superDesc != null);

    // The ASM model is to chain a bunch of visitors together.
    ClassWriter writer = new ClassWriter(0);
    ClassVisitor v = writer;

    // v = new CheckClassAdapter(v);
    // v = new TraceClassVisitor(v, new PrintWriter(System.out));

    String[] interfaces;
    if ("java/lang/Object".equals(superDesc)) {
      interfaces = null;
    } else {
      interfaces = new String[] {superDesc};
    }
    v.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC | Opcodes.ACC_INTERFACE, desc,
        null, "java/lang/Object", interfaces);
    v.visitEnd();
    return writer.toByteArray();
  }
View Full Code Here

    String desc = toDescriptor(className);
    assert (!jsoIntfDescs.contains(desc));

    // The ASM model is to chain a bunch of visitors together.
    ClassWriter writer = new ClassWriter(0);
    ClassVisitor v = writer;

    // v = new CheckClassAdapter(v);
    // v = new TraceClassVisitor(v, new PrintWriter(System.out));

    v = new RewriteRefsToJsoClasses(v, jsoIntfDescs, mapper);
View Full Code Here

    String superDesc = jsoSuperDescs.get(desc);
    assert (superDesc != null);

    // The ASM model is to chain a bunch of visitors together.
    ClassWriter writer = new ClassWriter(0);
    ClassVisitor v = writer;

    // v = new CheckClassAdapter(v);
    // v = new TraceClassVisitor(v, new PrintWriter(System.out));

    String[] interfaces;
    if ("java/lang/Object".equals(superDesc)) {
      interfaces = null;
    } else {
      interfaces = new String[] {superDesc};
    }
    v.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC | Opcodes.ACC_INTERFACE, desc,
        null, "java/lang/Object", interfaces);
    v.visitEnd();
    return writer.toByteArray();
  }
View Full Code Here

   * creating JRealClassType/JGenericType objects.
   */
  private CollectClassData processClass(TypeData typeData) {
    ClassReader reader = new ClassReader(typeData.byteCode);
    CollectClassData mcv = new CollectClassData();
    ClassVisitor cv = mcv;
    if (TRACE_CLASSES) {
      cv = new TraceClassVisitor(cv, new PrintWriter(System.out));
    }
    reader.accept(cv, 0);
    return mcv;
View Full Code Here

      String desc = toDescriptor(className);
      assert !jsoIntfDescs.contains(desc);

      // The ASM model is to chain a bunch of visitors together.
      ClassWriter writer = new ClassWriter(0);
      ClassVisitor v = writer;

      // v = new CheckClassAdapter(v);
      // v = new TraceClassVisitor(v, new PrintWriter(System.out));

      v = new UseMirroredClasses(v, className);
View Full Code Here

      assert superDescs != null;
      assert superDescs.size() > 0;

      // The ASM model is to chain a bunch of visitors together.
      ClassWriter writer = new ClassWriter(0);
      ClassVisitor v = writer;

      // v = new CheckClassAdapter(v);
      // v = new TraceClassVisitor(v, new PrintWriter(System.out));

      String[] interfaces;
      // TODO(bov): something better than linear?
      if (superDescs.contains("java/lang/Object")) {
         interfaces = null;
      } else {
         interfaces = superDescs.toArray(new String[superDescs.size()]);
      }
      v.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC | Opcodes.ACC_INTERFACE, desc, null,
               "java/lang/Object", interfaces);
      v.visitEnd();
      return writer.toByteArray();
   }
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.asm.ClassVisitor

Copyright © 2018 www.massapicom. 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.