Class DataPathSegmentsTranslationCache
java.lang.Object
com.e1c.langtool.v8.dt.translator.AbstractStringTranslationCache
com.e1c.langtool.v8.dt.form.translator.DataPathSegmentsTranslationCache
- All Implemented Interfaces:
SessionCache
Cache holds translation of all AbstractDataPath segments for every form
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetOrComputeTranslation(@NonNull AbstractDataPath source) Gets the or compute translation of segmets by givin data path.getTranslation(@NonNull AbstractDataPath source) Gets the translation of segment from cache without computing it if not exits.getTranslation(@NonNull AbstractDataPath source, @NonNull com.google.inject.Provider<List<String>> provider) Gets the translation of segments form cache or compute translation by the proiver and store it in cache.getTranslation(@NonNull org.eclipse.emf.common.util.URI formUri, @NonNull List<String> segments) Gets the translation of segments that stored in cache.getTranslation(@NonNull org.eclipse.emf.common.util.URI formUri, @NonNull List<String> segments, @NonNull com.google.inject.Provider<List<String>> provider) Gets the translation.voidinit(IProjectTranslationProvider translationProvider) Initialize the cache with translation provider on cache creation.Methods inherited from class com.e1c.langtool.v8.dt.translator.AbstractStringTranslationCache
clear, configureDb, dispose, get, get, getCacheMap, put, remove
-
Constructor Details
-
DataPathSegmentsTranslationCache
public DataPathSegmentsTranslationCache()
-
-
Method Details
-
init
Initialize the cache with translation provider on cache creation.- Parameters:
translationProvider- the translation provider
-
getTranslation
Gets the translation of segment from cache without computing it if not exits.- Parameters:
source- the source, cannot benull- Returns:
- the translation of segments, can return
nullif cache doesn't have translation
-
getOrComputeTranslation
Gets the or compute translation of segmets by givin data path.- Parameters:
source- the source data path, cannot benull- Returns:
- stored or computed translation of segments, can return
nullif cannot get or compute translation
-
getTranslation
public @Nullable List<String> getTranslation(@NonNull AbstractDataPath source, @NonNull com.google.inject.Provider<List<String>> provider) Gets the translation of segments form cache or compute translation by the proiver and store it in cache.- Parameters:
source- the source, cannot benullprovider- the provider of translates segments, cannot benull- Returns:
- the translation of segments form cache or from provider, can return
nullif cannot get or compute translation
-
getTranslation
public @Nullable List<String> getTranslation(@NonNull org.eclipse.emf.common.util.URI formUri, @NonNull List<String> segments, @NonNull com.google.inject.Provider<List<String>> provider) Gets the translation.- Parameters:
formUri- the form uri, cannot benullsegments- the source segments, cannot benullprovider- the provider to compute translation, cannot benull- Returns:
- the translation of sermgent from cache or from provider, can return
nullif cannot get or compute translation
-
getTranslation
public @Nullable List<String> getTranslation(@NonNull org.eclipse.emf.common.util.URI formUri, @NonNull List<String> segments) Gets the translation of segments that stored in cache.- Parameters:
formUri- the form uri, cannot benullsegments- the source segments, cannot benull- Returns:
- the translation of segments, can return
nullif not exists
-