Package org.objectweb.asm

Examples of org.objectweb.asm.ClassReader.accept()


    while (true) {
      ClassReader reader = getClassReader(javaClassName);
      FindFieldOrMethodClassVisitor visitor = new FindFieldOrMethodClassVisitor(false, name, c);
   
      try {
        reader.accept(visitor, false);
      } catch (Success s) {
        return true;
      }
      String[] is = visitor.classInterfaces;
      for (String i : is)
View Full Code Here


    String javaClassName = owner;
    while (true) {
      ClassReader reader = getClassReader(javaClassName);
      FindFieldOrMethodClassVisitor visitor = new FindFieldOrMethodClassVisitor(true, name, desc);
      try {
        reader.accept(visitor, false);
      } catch (Success s) {
        return true;
      }

      if (visitor.isInterface || visitor.isAbstract) {
View Full Code Here

            classVisitor = new SignatureStripper(classVisitor);
          }

          classVisitor = new AnnotationWeaver(classVisitor);

          cr.accept(classVisitor, CUSTOM_ATTRIBUTES, ClassReader.EXPAND_FRAMES);       

            if (COMPACT_CONSTANTS) {
              Set<Constant> constants = new TreeSet<Constant>(new ConstantComparator());
              constants.addAll(cp.values());
View Full Code Here

              cr = new ClassReader(cw.toByteArray());
                cw = new ClassWriter(0);
                for(Constant c: constants) {
                  c.write(cw);
                }
                cr.accept(cw, 0);
            }

          bos.write(cw.toByteArray());
          return true;
        } catch (TranslatorException te) {
View Full Code Here

      throws IOException {

    failedClasses = new HashSet<String>();

        ClassReader cr = new ClassReader(sourceStream);
        cr.accept(this, 0);
  }

  private void unknowClassWarning(String className, String msg) {
    StringBuffer report = new StringBuffer().append(currentclassName)
      .append(": unknown class ").append(className);
View Full Code Here

    while (true) {
      ClassReader reader = getClassReader(javaClassName);
      FindFieldOrMethodClassVisitor visitor = new FindFieldOrMethodClassVisitor(false, name, c);
   
      try {
        reader.accept(visitor, 0);
      } catch (Success s) {
        return true;
      }
      String[] is = visitor.classInterfaces;
      for (String i : is) {
View Full Code Here

    String javaClassName = owner;
    while (true) {
      ClassReader reader = getClassReader(javaClassName);
      FindFieldOrMethodClassVisitor visitor = new FindFieldOrMethodClassVisitor(true, name, desc);
      try {
        reader.accept(visitor, 0);
      } catch (Success s) {
        return true;
      }

      if (visitor.isInterface || visitor.isAbstract) {
View Full Code Here

            if (stripSignatures) {
                v = new SignatureStripper(classWeaver);
            } else {
              v = classWeaver;
            }
            cr.accept(v, CUSTOM_ATTRIBUTES, false);       

            if (COMPACT_CONSTANTS) {
              Set<Constant> constants = new TreeSet<Constant>(new ConstantComparator());
              constants.addAll(cp.values());
View Full Code Here

              cr = new ClassReader(cw.toByteArray());
                cw = new ClassWriter(false);
                for(Constant c: constants)
                  c.write(cw);
                cr.accept(cw, false);
            }

          bos.write(cw.toByteArray());
          return true;
        } catch (TranslationException te) {
View Full Code Here

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

  public ASMifier(final PrintWriter pw) {
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.