Module io.scif

Interface TranslatorService

    • 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 from
        dest - - Metadata to populate
        exact - - 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 from
        dest - - Metadata to populate
        exact - - 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 from
        dest - - Metadata to populate
        exact - - true if a translator that exactly matches these Metadata is desired
        Returns:
        true if translation was successful, and false otherwise.