Examples of ClassReader


Examples of aj.org.objectweb.asm.ClassReader

*/
public class StackMapAdder {

  public static byte[] addStackMaps(World world, byte[] data) {
    try {
      ClassReader cr = new ClassReader(data);
      ClassWriter cw = new AspectJConnectClassWriter(world);
      cr.accept(cw, 0);
      return cw.toByteArray();
    } catch (Throwable t) {
      System.err.println("AspectJ Internal Error: unable to add stackmap attributes. " + t.getMessage());
      AsmDetector.isAsmAround = false;
      return data;
View Full Code Here

Examples of br.com.caelum.vraptor.asm.ClassReader

                if (ze.isDirectory()) {
                    continue;
                }
                out.putNextEntry(ze);
                if (ze.getName().endsWith(".class")) {
                    ClassReader cr = new ClassReader(zf.getInputStream(ze));
                    // cr.accept(new ClassDump(), 0);
                    cr.accept(new ClassVerifier(), 0);
                }
                InputStream is = zf.getInputStream(ze);
                int n;
                do {
                    n = is.read(buf, 0, buf.length);
View Full Code Here

Examples of ca.svarb.utils.ClassReader

    ArgumentChecker.checkNulls("optionsTitle", optionsTitle);
    this.optionsInterface = optionsInterface;
    this.firstLinePrefix=firstLinePrefix;
    this.otherPrefix=otherLinesPrefix;
    this.optionsTitle=optionsTitle;
    classReader = new ClassReader(optionsInterface);
    usageParser = new UsageParser(classReader);
    classMaker = new ClassMaker();
  }
View Full Code Here

Examples of com.alibaba.citrus.asm.ClassReader

            for (int i = 0; i < files.length; ++i) {
                optimize(files[i], d, remapper);
            }
        } else if (f.getName().endsWith(".class")) {
            ConstantPool cp = new ConstantPool();
            ClassReader cr = new ClassReader(new FileInputStream(f));
            ClassWriter cw = new ClassWriter(0);
            ClassConstantsCollector ccc = new ClassConstantsCollector(cw, cp);
            ClassOptimizer co = new ClassOptimizer(ccc, remapper);
            cr.accept(co, ClassReader.SKIP_DEBUG);

            Set constants = new TreeSet(new ConstantComparator());
            constants.addAll(cp.values());

            cr = new ClassReader(cw.toByteArray());
            cw = new ClassWriter(0);
            Iterator i = constants.iterator();
            while (i.hasNext()) {
                Constant c = (Constant) i.next();
                c.write(cw);
            }
            cr.accept(cw, ClassReader.SKIP_DEBUG);

            if (MAPPING.getProperty(cr.getClassName() + "/remove") != null) {
                return;
            }
            String n = remapper.mapType(cr.getClassName());
            File g = new File(d, n + ".class");
            if (!g.exists() || g.lastModified() < f.lastModified()) {
                g.getParentFile().mkdirs();
                OutputStream os = new FileOutputStream(g);
                os.write(cw.toByteArray());
View Full Code Here

Examples of com.avaje.ebean.enhance.asm.ClassReader

  private String getSuperType(String type) throws ClassNotFoundException
  {
    ApplicationClass ac = Play.classes.getApplicationClass(type.replace('/', '.'));
    try {
      return ac != null ? new ClassReader(ac.enhancedByteCode).getSuperName() : new ClassReader(type).getSuperName();
    } catch (IOException e) {
      throw new ClassNotFoundException(type);
    }
  }
View Full Code Here

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

            System.err.println("Prints a disassembled view of the given class.");
            System.err.println("Usage: TraceClassVisitor [-debug] "
                    + "<fully qualified class name or class file name>");
            return;
        }
        ClassReader cr;
        if (args[i].endsWith(".class") || args[i].indexOf('\\') > -1
                || 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);
    }
View Full Code Here

Examples of com.googlecode.aviator.asm.ClassReader

            System.err.println("Verifies the given class.");
            System.err.println("Usage: CheckClassAdapter "
                    + "<fully qualified class name or class file name>");
            return;
        }
        ClassReader cr;
        if (args[0].endsWith(".class")) {
            cr = new ClassReader(new FileInputStream(args[0]));
        } else {
            cr = new ClassReader(args[0]);
        }

        verify(cr, false, new PrintWriter(System.err));
    }
View Full Code Here

Examples of com.sleepycat.asm.ClassReader

        /* The enhancer is at the beginning of the visitor chain. */
        visitor = new BytecodeEnhancer(visitor);

        /* The reader processes the class and invokes the visitors. */
        ClassReader reader = new ClassReader(bytes);
        try {

            /*
             * Pass false for skipDebug since we are rewriting the class and
             * should include all information.
             */
            reader.accept(visitor, false);
            return writer.toByteArray();
        } catch (BytecodeEnhancer.NotPersistentException e) {
            /* The class is not persistent and should not be enhanced. */
            return null;
        }
View Full Code Here

Examples of com.sun.corba.ee.org.objectweb.asm.ClassReader

        return methods;
    }

    public ASMClassFile(InputStream is)
            throws IOException {
        cr = new ClassReader(is);
        cr.accept(new MyVisitor(this), true);
        is.close();
    }
View Full Code Here

Examples of com.sun.tools.javac.jvm.ClassReader

@author Neal Gafter
*/
public class JavadocClassReader extends ClassReader {

    public static JavadocClassReader instance0(Context context) {
        ClassReader instance = context.get(classReaderKey);
        if (instance == null)
            instance = new JavadocClassReader(context);
        return (JavadocClassReader)instance;
    }
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.