Package com.e1c.langtool.storage
Interface ITranslationStorageProvider.Storage
- All Known Subinterfaces:
ITranslationStorageProvider.ContextStorage,ITranslationStorageProvider.DictionaryStorage
- All Known Implementing Classes:
AbstractFileStorage,ContextDefStorage,ContextFileStorage,DbViewTermsStorage,DictionaryFileStorage
- Enclosing interface:
- ITranslationStorageProvider
public static interface ITranslationStorageProvider.Storage
The Interface Storage.
Allows to store translations in particular segment of provider.
Provider must return at least one default storage.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumAn enum describes a type of storage. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidAdds the batch update notification.voidAdds a listener for post value changes in this storage.voidInform storage about planned batch update.voidEnd storage batch update.getId()Gets the id of storage.The unique segment.getTranslation(FeatureValue source, TranslateLanguage language) Gets the translation from storage.getType()Returns the type of translation storage.default booleanChecks if the storage is read only.voidmoveTranslation(FeatureValue fromSource, FeatureValue toSource, TranslateLanguage language, boolean autoSave) Move translation inside the storage from one key to enother.voidremoveTranslation(FeatureValue source, TranslateLanguage language, boolean autoSave) Removes the translation from storage.voidRemoves the given listener for post value changes from this storage.voidsetTranslation(FeatureValue source, TranslateLanguage language, String translation, boolean autoSave) Sets the translation.
-
Method Details
-
getId
StorageID getId()Gets the id of storage.- Returns:
- the id. Cannot return
null.
-
getSegment
String getSegment()The unique segment.- Returns:
- the segment
-
addValueChangedListener
Adds a listener for post value changes in this storage. Has no effect if an identical listener is already registered.- Parameters:
listener- the listener
-
removeValueChangedListener
Removes the given listener for post value changes from this storage. Has no effect if an identical listener is not registered.- Parameters:
listener- the listener
-
addBatchUpdateNotification
Adds the batch update notification.- Parameters:
event- the event, cannot benull
-
getTranslation
Gets the translation from storage.- Parameters:
source- the source feature valuelanguage- the language- Returns:
- the translation
-
setTranslation
void setTranslation(FeatureValue source, TranslateLanguage language, String translation, boolean autoSave) Sets the translation.- Parameters:
source- the source feature valuelanguage- the languagetranslation- the translation- Throws:
ModelValueAlreadyInUseException- if translation for model feature is already set for another key
-
removeTranslation
Removes the translation from storage.- Parameters:
source- the source feature valuelanguage- the language
-
moveTranslation
void moveTranslation(FeatureValue fromSource, FeatureValue toSource, TranslateLanguage language, boolean autoSave) Move translation inside the storage from one key to enother.- Parameters:
fromSource- the source feature value to move fromtoSource- the source feature value to move tolanguage- the language- Throws:
ModelValueAlreadyInUseException- if translation for model feature is already set for another key
-
getType
ITranslationStorageProvider.Storage.Type getType()Returns the type of translation storage.- Returns:
- the type of storage
- See Also:
-
beginBatchUpdate
void beginBatchUpdate()Inform storage about planned batch update. Storage implementation may use this information for work optimization. After batch update doneendUpdate()must be called. Nested updates supported. Update mode end when lastendUpdate()paired to called. -
endBatchUpdate
void endBatchUpdate()End storage batch update. -
isReadOnly
default boolean isReadOnly()Checks if the storage is read only.- Returns:
- true, if the storage is read only
-