Interface IProjectTranslationProvider

All Known Implementing Classes:
ExtensionProjectTranslationProvider, ExternalProjectTranslationProvider, ProjectTranslationProvider

public interface IProjectTranslationProvider
The Interface IProjectTranslationProvider.
  • Method Details

    • getCache

      <T extends SessionCache> T getCache(Class<T> clazz)
      Gets the cache instance of given type.
      Type Parameters:
      T - the generic type of the cache
      Parameters:
      clazz - the class of the cache, cannot be null.
      Returns:
      the existing or newly created cache instance, cannot return null.
    • allCaches

      Collection<SessionCache> allCaches()
      Get all caches instances
      Returns:
      the collection of session caches. The collection cannot be modified, cannot return null.
      See Also:
    • dispose

      default void dispose()
      Dispose the data of translation provider.
    • getTranslation

      String getTranslation(org.eclipse.emf.ecore.EObject source, EFeatureSettings featureSettings, TranslateLanguage language)
      Gets the translation for the given source EObject. It compute feature key and creates FeatureValue to get stored translation in ITranslationStorageProvider.Storage
      Parameters:
      source - the source, cannot be null.
      featureSettings - the feature settings, cannot be null.
      language - the language, cannot be null.
      Returns:
      the translation, may return null if has no translation.
    • getOptionalTranslation

      Optional<String> getOptionalTranslation(org.eclipse.emf.ecore.EObject source, EFeatureSettings featureSettings, TranslateLanguage language)
      Gets the translation for the given source EObject. It compute feature key and creates FeatureValue to get stored translation in ITranslationStorageProvider.Storage
      Parameters:
      source - the source, cannot be null.
      featureSettings - the feature settings, cannot be null.
      language - the language, cannot be null.
      Returns:
      the optional translation, cannot return null.
    • getOptionalTranslation

      Optional<String> getOptionalTranslation(org.eclipse.emf.ecore.EObject source, ContextTranslationKey key, TranslateLanguage language)
      Gets the translation for the given ContextTranslationKey and if has no translation stored in ITranslationStorageProvider.Storage tries to compute translation by give source EObject.
      Parameters:
      source - the source object, cannot be null.
      key - the context translation key of the source eObject, cannot be null.
      language - the language to translate into, cannot be null.
      Returns:
      the optional translation, cannot return null.
    • getTranslation

      String getTranslation(org.eclipse.emf.ecore.EObject source, ContextTranslationKey key, TranslateLanguage language)
      Gets the translation for the given ContextTranslationKey and if has no translation stored in ITranslationStorageProvider.Storage tries to compute translation by give source EObject.
      Parameters:
      source - the source object, cannot be null.
      key - the context translation key of the source eObject, cannot be null.
      language - the language to translate into, cannot be null.
      Returns:
      the translation
    • getStoredTranslation

      String getStoredTranslation(ContextTranslationKey key, TranslateLanguage language, ITranslationStorageProvider.Storage.Type... storageTypes)
      Gets the stored translation directly from storages of project.
      Parameters:
      key - the context translation key, cannot be null.
      language - the language to translate into, cannot be null.
      storageTypes - the storage types, may be null for all types of stoarages.
      Returns:
      the stored translation, can return null.
    • getProject

      ITranslatedV8Project getProject()
      Gets the translated V8 project.
      Returns:
      the project, cannot return null.