org.scijava.module.process
Class ServicePreprocessor

java.lang.Object
  extended by org.scijava.AbstractContextual
      extended by org.scijava.module.process.AbstractPreprocessorPlugin
          extended by org.scijava.module.process.ServicePreprocessor
All Implemented Interfaces:
Cancelable, Contextual, ModulePreprocessor, ModuleProcessor, PreprocessorPlugin, SciJavaPlugin

public class ServicePreprocessor
extends AbstractPreprocessorPlugin

The service preprocessor automatically populates module inputs that implement Service.

Services are obtained from this preprocessor instance's application context.

Many modules (e.g., most Commands) use @Parameter-annotated service fields, resulting in those parameters being populated when the SciJava application context is injected (via Context.inject(Object). However, some modules may have service parameters which are programmatically generated (i.e., returned directly as inputs from ModuleInfo.inputs() and as such not populated by context injection. E.g., this situation is the case for scripts, since module inputs are parsed from the script header rather than declared via the @Parameter annotation. In such cases, we need this service preprocessor to fill in the service values.

Author:
Curtis Rueden

Constructor Summary
ServicePreprocessor()
           
 
Method Summary
 void process(Module module)
          Performs a processing step on the given module instance.
 
Methods inherited from class org.scijava.module.process.AbstractPreprocessorPlugin
cancel, getCancelReason, isCanceled
 
Methods inherited from class org.scijava.AbstractContextual
context, getContext, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 

Constructor Detail

ServicePreprocessor

public ServicePreprocessor()
Method Detail

process

public void process(Module module)
Description copied from interface: ModuleProcessor
Performs a processing step on the given module instance.



Copyright © 2009–2014 SciJava. All rights reserved.