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.
  • 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

      void addValueChangedListener(IStorageValueChangedListener listener)
      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

      void removeValueChangedListener(IStorageValueChangedListener listener)
      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

      default void addBatchUpdateNotification(StorageValueChangeEvent event)
      Adds the batch update notification.
      Parameters:
      event - the event, cannot be null
    • getTranslation

      String getTranslation(FeatureValue source, TranslateLanguage language)
      Gets the translation from storage.
      Parameters:
      source - the source feature value
      language - the language
      Returns:
      the translation
    • setTranslation

      void setTranslation(FeatureValue source, TranslateLanguage language, String translation, boolean autoSave)
      Sets the translation.
      Parameters:
      source - the source feature value
      language - the language
      translation - the translation
      Throws:
      ModelValueAlreadyInUseException - if translation for model feature is already set for another key
    • removeTranslation

      void removeTranslation(FeatureValue source, TranslateLanguage language, boolean autoSave)
      Removes the translation from storage.
      Parameters:
      source - the source feature value
      language - 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 from
      toSource - the source feature value to move to
      language - the language
      Throws:
      ModelValueAlreadyInUseException - if translation for model feature is already set for another key
    • 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 done endUpdate() must be called. Nested updates supported. Update mode end when last endUpdate() 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