Package repast.simphony.engine.watcher
Class WatcheeDataFinder
java.lang.Object
repast.simphony.engine.watcher.WatcheeDataFinder
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
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addClassToFind
(String className, String fieldName) Adds the named class as a Watchee to find and the specified field to watch.void
addPathToSearch
(String path) Adds fields and watchees to watch from any @Watch annotations on any class that this finds in the specified path.data()
Gets an iteratable over the WatcheeData found and created by this WatcheeDataFinder.Finds @Watch annotations and creates WatcheeData from them.
-
Constructor Details
-
WatcheeDataFinder
-
-
Method Details
-
addClassToFind
Adds the named class as a Watchee to find and the specified field to watch.- Parameters:
className
- the field's classfieldName
- the field to watch
-
addPathToSearch
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
public WatcheeDataFinder.FinderResult run(String classpath, Filter<String> filter) throws IOException, ClassNotFoundException 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
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.
-