Пример #1
0
 public MethodVisitor visitMethod(
     int access, String _name, String desc, String sig, String[] exceptions) {
   ByteCodeMethodVisitor bcmv = new ByteCodeMethodVisitor(access, _name, desc, sig, exceptions);
   methodVisitors.put(_name + desc, bcmv);
   bcmv.print();
   return bcmv;
 }
Пример #2
0
  public void print() {
    Iterator it = fieldVisitors.entrySet().iterator();

    while (it.hasNext()) {
      Map.Entry pairs = (Map.Entry) it.next();
      System.out.println("Printing Field: " + pairs.getKey() + ":");
      ByteCodeFieldVisitor fv = (ByteCodeFieldVisitor) pairs.getValue();
      fv.print();
    }

    it = methodVisitors.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry pairs = (Map.Entry) it.next();
      ByteCodeMethodVisitor bcmv = (ByteCodeMethodVisitor) pairs.getValue();
      System.out.println("Printing Method: Key = " + pairs.getKey() + " bcmv says " + bcmv.name);

      bcmv.print();
    }
  }