discover
call? Or does classgraph cache things?
ideally, you'd do this just once at the begin and then re-use it whenever you want to extract anything
I think at the end of the day you are going to be caching the results of the discover
call, so I can't see a situation where you're going to be calling discover
enough times to be worried about this?
@Plugin
would be straightforward.
@gselzer Made some progress on the PR chain:
I also rebased a couple of old topic branches and pushed them to stale/
prefix to clarify that they are old and may be obsolete now. I didn't finish going through all topic branches on the incubator yet, but the plan is to do that.
Discoverer<?>
e.g. from the ServiceLoader
.
Discoverer
implementations much cleaner
To summarize, TherapiDiscoverer
is an abstract class, whose subclasses need to implement (among less important things):
protected abstract <U> U convert(Discovery<AnnotatedElement> e, Class<U> c);
This method is called by
@Override
public <U> List<U> discover(Class<U> c) {
if (!canDiscover(c))
return Collections.emptyList();
List<Discovery<AnnotatedElement>> elements = elementsTaggedWith(tagType());
return convertEach(elements, c);
}
Discovery
in this one instance, that class will probably be moved into SciJava Discovery Therapi
Op
s/OpCollection
s to the StaticDiscoverer
in tests
Discoverer
s are supposed to give a list of instances
NilConverter