Пример #1
0
  public static void setup() {
    // CREATE WALKER OBJECT
    Walker walker = new Walker(BUFFER);
    // load program properties
    Config config = new Config("props/superD.properties");

    // list of directories to scan
    ArrayList<File> rootDirs = new ArrayList<File>(1);

    // Load in all directories to scan from properties file into rootDirs ArrayList
    try {
      String dil = config.getConfig("ROOT_DIL");
      String rootDirList = config.getConfig("ROOT");
      List<String> rootDirListArr = Arrays.asList(rootDirList.split(dil));

      for (int i = 0; i < rootDirListArr.size(); i++) {
        rootDirs.add(new File(rootDirListArr.get(i)));
      }
    } catch (ConfigException e) {
      log.fatal("Failed to read config file!", e);
    }
    // Call Walker.walk() on all the directories in rootDirs
    try {
      for (int i = 0; i < rootDirs.size(); i++) {
        // make sure that it is a directory
        if (rootDirs.get(i).isDirectory()) {
          walker.walk(rootDirs.get(i));
        } else {
          log.debug(
              rootDirs.get(i).toString()
                  + "  Appears to not be a directory; skipping to next in list");
        }
      }
      // TODO replace generic Exception with specific exception(s)
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
 public <ARG, EXN extends Exception> void accept(Walker<ARG, EXN> vis, ARG arg) throws EXN {
   vis.visit((PostExpArgs) this, arg);
 }
 public <ARG, EXN extends Exception> void accept(Walker<ARG, EXN> vis, ARG arg) throws EXN {
   vis.visit((ClsPatDef) this, arg);
 }
 public <ARG, EXN extends Exception> void accept(Walker<ARG, EXN> vis, ARG arg) throws EXN {
   vis.visit((DotMethodCallExp) this, arg);
 }
 public <ARG, EXN extends Exception> void accept(Walker<ARG, EXN> vis, ARG arg) throws EXN {
   vis.visit((CmdsInAList) this, arg);
 }