Package net.sf.joafip.asm

Examples of net.sf.joafip.asm.ClassReader.accept()


    final byte[] originalCode = byteOutputStream.toByteArray();
    final int off = 0;
    final int len = originalCode.length;
    final ClassReader classreader = new ClassReader(originalCode, off, len);
    try {
      classreader.accept(this, ClassReader.SKIP_FRAMES);
    } catch (RuntimeEnhanceException exception) {
      throw (EnhanceException) exception.getCause();
    }
    if (logger.debugEnabled) {
      logger.debug(checkMethodListener.unassembled());
View Full Code Here


        || args[i].indexOf('/') > -1) {
      cr = new ClassReader(new FileInputStream(args[i]));
    } else {
      cr = new ClassReader(args[i]);
    }
    cr.accept(new ASMifierClassVisitor(new PrintWriter(System.out)),
        getDefaultAttributes(), flags);
  }

  public static void outAsm(final boolean debug,
      final InputStream inputStream, final String outputFileName)
View Full Code Here

      flags = 0;
    }
    ClassReader cr;
    cr = new ClassReader(inputStream);
    PrintWriter printWriter = new PrintWriter(outputFileName);
    cr.accept(new ASMifierClassVisitor(printWriter),
        getDefaultAttributes(), flags);
    printWriter.close();
  }

  public static void outAsm(final boolean debug, final String inputFileName,
View Full Code Here

      flags = 0;
    }
    ClassReader cr;
    cr = new ClassReader(inputFileName);
    PrintWriter printWriter = new PrintWriter(outputFileName);
    cr.accept(new ASMifierClassVisitor(printWriter),
        getDefaultAttributes(), flags);
    printWriter.close();
  }

  /**
 
View Full Code Here

        || args[i].indexOf('/') > -1) {
      cr = new ClassReader(new FileInputStream(args[i]));
    } else {
      cr = new ClassReader(args[i]);
    }
    cr.accept(new TraceClassVisitor(new PrintWriter(System.out)),
        getDefaultAttributes(), flags);
  }

  /**
   * Constructs a new {@link TraceClassVisitor}.
View Full Code Here

    final MethodMap methodMap = new MethodMap();
    final Set<String> syntheticFieldSet = new TreeSet<String>();
    final ClassVisitorForStorable classVisitorForStorable = new ClassVisitorForStorable();
    classVisitorForStorable.setMethodMap(methodMap, syntheticFieldSet);
    // must not skip code to compute max locals
    classReader.accept(classVisitorForStorable, /* ClassReader.SKIP_CODE | */
        ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
    final Set<Entry<MethodMapKey, Integer>> entrySet = methodMap.entrySet();
    for (Entry<MethodMapKey, Integer> entry : entrySet) {
      final MethodMapKey key = entry.getKey();
      System.out.println("maxs local " + key.getMethodName() + " "// NOPMD
View Full Code Here

      final byte[] originalCode = byteOutputStream.toByteArray();
      final int off = 0;
      final int len = originalCode.length;
      final ClassReader classReader = new ClassReader(originalCode, off,
          len);
      classReader.accept(this, ClassReader.SKIP_FRAMES);
    } catch (IOException exception) {
      throw new EnhanceException(exception);
    } catch (RuntimeEnhanceException exception) {
      throw (EnhanceException) exception.getCause();
    }
View Full Code Here

    final IMethodMap methodMap = new MethodMap();
    final Set<String> syntheticFieldSet = new TreeSet<String>();
    final ClassVisitorForStorable classVisitorForStorable = new ClassVisitorForStorable();
    classVisitorForStorable.setMethodMap(methodMap, syntheticFieldSet);
    // must not skip code to compute max locals
    classReader.accept(classVisitorForStorable, /* ClassReader.SKIP_CODE | */
        ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);

    // annotation override instrumentation properties
    transformationAttribute = classVisitorForStorable
        .getTransformationType();
View Full Code Here

      final ClassVisitor classVisitor = new ClassVisitorForPersistable(
          classWriter, methodMap, syntheticFieldSet,
          transformationAttribute, node);

      // classReader = new ClassReader(originalCode, off, len);
      classReader.accept(classVisitor, 0);
      code = classWriter.toByteArray();
    }
    return code;
  }
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.