File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
src/main/java/org/scijava/plugin Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 5252public interface TypedService <DT , PT extends TypedPlugin <DT >> extends
5353 PTService <PT >, Typed <DT >
5454{
55- // NB: Marker interface.
55+
56+ /**
57+ * Gets a new instance of the highest priority plugin managed by this service
58+ * which supports the given data object according to the {@link Typed}
59+ * interface.
60+ * <p>
61+ * Note that this newly created plugin instance will <em>not</em> actually be
62+ * injected with the given data object!
63+ * </p>
64+ *
65+ * @see HandlerService#getHandler(Object)
66+ * @see WrapperService#create(Object)
67+ */
68+ default PT find (final DT data ) {
69+ for (final PluginInfo <PT > plugin : getPlugins ()) {
70+ final PT instance = pluginService ().createInstance (plugin );
71+ if (instance != null && instance .supports (data )) return instance ;
72+ }
73+ return null ;
74+ }
5675}
You can’t perform that action at this time.
0 commit comments