Class WatcheeDataFinder

java.lang.Object
repast.simphony.engine.watcher.WatcheeDataFinder

public class WatcheeDataFinder extends Object
Finds the Watchee info for instrumentation by searching paths for classes with @Watch annotations, as well as looking for specified watcher classes in those paths.
Author:
Nick Collier
  • Constructor Details

  • Method Details

    • addClassToFind

      public void addClassToFind(String className, String fieldName)
      Adds the named class as a Watchee to find and the specified field to watch.
      Parameters:
      className - the field's class
      fieldName - the field to watch
    • addPathToSearch

      public void addPathToSearch(String path)
      Adds fields and watchees to watch from any @Watch annotations on any class that this finds in the specified path. The path can be a top level class directory of classes or a jar file.
      Parameters:
      path -
    • run

      Finds @Watch annotations and creates WatcheeData from them.
      Returns:
      a successful FinderResult if the run was successful and all classes that were tagged as watchees were found, otherwise an unsuccessful finder result with an explanatory message.
      Throws:
      ClassNotFoundException
      IOException
    • data

      public Iterable<WatcheeData> data()
      Gets an iteratable over the WatcheeData found and created by this WatcheeDataFinder. WatcheeData is ordered according to inheritence hierarchy such that parent classes will appear before their children.
      Returns:
      an iteratable over the WatcheeData found and created by this WatcheeDataFinder.