Interface IProjectTranslationProvider
- All Known Implementing Classes:
ExtensionProjectTranslationProvider,ExternalProjectTranslationProvider,ProjectTranslationProvider
public interface IProjectTranslationProvider
The Interface IProjectTranslationProvider.
-
Method Summary
Modifier and TypeMethodDescriptionGet all caches instancesdefault voiddispose()Dispose the data of translation provider.<T extends SessionCache>
TGets the cache instance of given type.getOptionalTranslation(org.eclipse.emf.ecore.EObject source, ContextTranslationKey key, TranslateLanguage language) Gets the translation for the givenContextTranslationKeyand if has no translation stored inITranslationStorageProvider.Storagetries to compute translation by give sourceEObject.getOptionalTranslation(org.eclipse.emf.ecore.EObject source, EFeatureSettings featureSettings, TranslateLanguage language) Gets the translation for the given sourceEObject.Gets the translated V8 project.getStoredTranslation(ContextTranslationKey key, TranslateLanguage language, ITranslationStorageProvider.Storage.Type... storageTypes) Gets the stored translation directly from storages of project.getTranslation(org.eclipse.emf.ecore.EObject source, ContextTranslationKey key, TranslateLanguage language) Gets the translation for the givenContextTranslationKeyand if has no translation stored inITranslationStorageProvider.Storagetries to compute translation by give sourceEObject.getTranslation(org.eclipse.emf.ecore.EObject source, EFeatureSettings featureSettings, TranslateLanguage language) Gets the translation for the given sourceEObject.
-
Method Details
-
getCache
Gets the cache instance of given type.- Type Parameters:
T- the generic type of the cache- Parameters:
clazz- the class of the cache, cannot benull.- 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 sourceEObject. It compute feature key and createsFeatureValueto get stored translation inITranslationStorageProvider.Storage- Parameters:
source- the source, cannot benull.featureSettings- the feature settings, cannot benull.language- the language, cannot benull.- Returns:
- the translation, may return
nullif has no translation.
-
getOptionalTranslation
Optional<String> getOptionalTranslation(org.eclipse.emf.ecore.EObject source, EFeatureSettings featureSettings, TranslateLanguage language) Gets the translation for the given sourceEObject. It compute feature key and createsFeatureValueto get stored translation inITranslationStorageProvider.Storage- Parameters:
source- the source, cannot benull.featureSettings- the feature settings, cannot benull.language- the language, cannot benull.- 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 givenContextTranslationKeyand if has no translation stored inITranslationStorageProvider.Storagetries to compute translation by give sourceEObject.- Parameters:
source- the source object, cannot benull.key- the context translation key of the source eObject, cannot benull.language- the language to translate into, cannot benull.- 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 givenContextTranslationKeyand if has no translation stored inITranslationStorageProvider.Storagetries to compute translation by give sourceEObject.- Parameters:
source- the source object, cannot benull.key- the context translation key of the source eObject, cannot benull.language- the language to translate into, cannot benull.- 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 benull.language- the language to translate into, cannot benull.storageTypes- the storage types, may benullfor 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.
-