Package net.sf.rej.gui

Examples of net.sf.rej.gui.IterationContext


      this.listener.finished();
    }
  }
 
  private void iterateOneAgent(IteratorAgent agent) {
    IterationContext ic = new IterationContext();
    ic.setProject(this.project);
    FileSet fs = this.project.getFileSet();
    List<String> contents = fs.getContentsList();
    agent.scopeChanged(0, contents.size());
    int progress = 0;
    for (String filename : contents) {
      agent.progressed(progress++);
      ic.setFilename(filename);
      agent.processFile(filename);
      if (!filename.endsWith(".class"))
        continue;
      try {
        ClassFile cf = this.project.getClassFile(filename);
        ic.setCf(cf);
        agent.processClass(ic, cf);
       
        ConstantPool cp = cf.getPool();
        for (int i=0; i < cp.size(); i++) {
          ConstantPoolInfo cpi = cp.get(i);
          if (cpi != null) {
            agent.processConstantPoolInfo(ic, cpi);           
          }
        }

        List<Interface> interfaces = cf.getInterfaces();
        for (Interface interface0 : interfaces) {
          agent.processInterface(ic, interface0.getName());
        }

        List<Field> fields = cf.getFields();
        for (Field field : fields) {
          ic.setField(field);
          agent.processField(ic, field);
        }

        List<Method> methods = cf.getMethods();
        for (Method method : methods) {
          ic.setMethod(method);
          agent.processMethod(ic, method);

          CodeAttribute ca = method.getAttributes().getCode();
          ic.setCodeAttribute(ca);
          if (ca != null) {
            processAttributes(ic, ca.getAttributes(), agent);
          }
          // method variables
          LocalVariableTableAttribute lvt = null;
          if (ca != null) {
            lvt = ca.getAttributes().getLocalVariableTable();
          }
          if (lvt != null) {
            List<LocalVariable> lvs = lvt.getLocalVariables();

            for (LocalVariable lv : lvs) {
              agent.processLocalVariable(ic, lv);
            }
          }

          // method code
          Code code = null;
          if (ca != null)
            code = ca.getCode();
          if (code != null) {
            DecompilationContext dc = code
                .createDecompilationContext();
            ic.setDc(dc);
            dc.setPosition(0);
            List<Instruction> instructions = code.getInstructions();
            for (Instruction instruction : instructions) {
              agent.processInstruction(ic, instruction);
              dc.incrementPosition(instruction);
View Full Code Here

TOP

Related Classes of net.sf.rej.gui.IterationContext

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.