public class DefaultTranslatorService extends org.scijava.plugin.AbstractSingletonService<Translator> implements TranslatorService
TranslatorService implementation. If a false exact flag is
passed to findTranslator(Metadata, Metadata, boolean) and an exact
translator can not be found, this service will first try to match the
destination type, then source type, then will accept any generic
Metadata translator.| Constructor and Description |
|---|
DefaultTranslatorService() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
Class<Translator> |
getPluginType() |
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.
|
getInstance, getInstances, objectService, onEvent, onEventpluginServicegetContext, setContext, toStringgetInfo, getPriority, setInfo, setPrioritycontextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreate, filterInstances, getInstance, getInstances, initialize, objectServicegetPlugins, getPluginService, pluginServiceregisterEventHandlersgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersiondisposepublic Translator findTranslator(Metadata source, Metadata dest, boolean exact)
TranslatorServicefindTranslator in interface TranslatorServicesource - - Metadata to read fromdest - - Metadata to populateexact - - true if a translator that exactly matches these Metadata is
desiredpublic Translator findTranslator(Class<? extends Metadata> source, Class<? extends Metadata> dest, boolean exact)
TranslatorServicefindTranslator in interface TranslatorServicesource - - Metadata to read fromdest - - Metadata to populateexact - - true if a translator that exactly matches these Metadata is
desiredpublic boolean translate(Metadata source, Metadata dest, boolean exact)
TranslatorServiceUseful if you don't need a handle on the Translator itself.
translate in interface TranslatorServicesource - - Metadata to read fromdest - - Metadata to populateexact - - true if a translator that exactly matches these Metadata is
desiredpublic Class<Translator> getPluginType()
getPluginType in interface org.scijava.plugin.PTService<Translator>Copyright © 2011–2026 SCIFIO. All rights reserved.