-
- All Superinterfaces:
Comparable<org.scijava.Prioritized>,org.scijava.Contextual,org.scijava.Disposable,org.scijava.plugin.HasPluginInfo,org.scijava.Identifiable,org.scijava.Initializable,org.scijava.Locatable,org.scijava.log.Logged,org.scijava.Prioritized,org.scijava.plugin.PTService<Translator>,org.scijava.plugin.RichPlugin,SCIFIOService,org.scijava.plugin.SciJavaPlugin,org.scijava.service.Service,org.scijava.plugin.SingletonService<Translator>,org.scijava.Versioned
- All Known Implementing Classes:
DefaultTranslatorService
public interface TranslatorService extends SCIFIOService, org.scijava.plugin.SingletonService<Translator>
Collection of methods for creating and using appropriate Translators to convert between Metadata types.- Author:
- Mark Hiner
- See Also:
Translator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TranslatorfindTranslator(Metadata source, Metadata dest, boolean exact)Returns a translator capable of translating from the source Metadata to the dest Metadata type, or null if no such Translator exists.TranslatorfindTranslator(Class<? extends Metadata> source, Class<? extends Metadata> dest, boolean exact)Returns a translator capable of translating from the source Metadata to the dest Metadata type, or null if no such Translator exists.booleantranslate(Metadata source, Metadata dest, boolean exact)Convenience method to immediately translate from the source Metadata to the dest Metadata type, assuming an appropriate Translator is found.-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.Disposable
dispose
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.PTService
getPlugins, getPluginService, getPluginType, pluginService
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.service.Service
registerEventHandlers
-
Methods inherited from interface org.scijava.plugin.SingletonService
create, filterInstances, getInstance, getInstances, initialize, objectService
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
findTranslator
Translator findTranslator(Metadata source, Metadata dest, boolean exact)
Returns a translator capable of translating from the source Metadata to the dest Metadata type, or null if no such Translator exists.- Parameters:
source- - Metadata to read fromdest- - Metadata to populateexact- - true if a translator that exactly matches these Metadata is desired- Returns:
- Translator whose translate method will accept these Metadata instances
-
findTranslator
Translator findTranslator(Class<? extends Metadata> source, Class<? extends Metadata> dest, boolean exact)
Returns a translator capable of translating from the source Metadata to the dest Metadata type, or null if no such Translator exists.- Parameters:
source- - Metadata to read fromdest- - Metadata to populateexact- - true if a translator that exactly matches these Metadata is desired- Returns:
- Translator whose translate method will accept these Metadata instances
-
translate
boolean translate(Metadata source, Metadata dest, boolean exact)
Convenience method to immediately translate from the source Metadata to the dest Metadata type, assuming an appropriate Translator is found.Useful if you don't need a handle on the Translator itself.
- Parameters:
source- - Metadata to read fromdest- - Metadata to populateexact- - true if a translator that exactly matches these Metadata is desired- Returns:
- true if translation was successful, and false otherwise.
-
-