Interface DataTranslationHandler

  • All Known Implementing Classes:
    DataTranslationHandlerImpl

    public interface DataTranslationHandler
    Handler class used to access data translations
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addToStorage​(DataTranslation translation)
      Adds to the data translation storage the given data translation.
      String getName​(NamedEntity entity)
      Returns the customized translation (or default value) for the name property of the given given entity, on the current language
      String getName​(Language language, NamedEntity entity)
      Returns the customized translation (or default value) for the name property of the given given entity, on the given language
      String getValue​(BaseEntity entity, com.querydsl.core.types.dsl.StringPath path)
      Returns the customized translation (or default value) for the given property of the given given entity, on the current language
      String getValue​(BaseEntity entity, String propertyName, boolean fallbackToDefault)
      Same as getValue(Language, BaseEntity, String, boolean) but for the current language
      String getValue​(Language language, BaseEntity entity, com.querydsl.core.types.dsl.StringPath path)
      Returns the customized translation (or default value) for the given property of the given given entity, on the given language
      String getValue​(Language language, BaseEntity entity, String propertyName, boolean fallbackToPropertyValue)
      Returns the customized translation (or default value) traversing the language's hierarchy for the tuple <language, entity, property>
      String getValue​(Language language, BaseEntity entity, String propertyName, boolean fallbackToPropertyValue, boolean traverseHierachy)
      Returns the customized translation for the tuple <language, entity, property>, optionally returning the default property value (if fallbackToPropertyValue is true and there is no such translation).
      The flag traverseHierachy is used to indicate if the language's hierarchy must be traversed (to the root) searching for translations.
      void removeFromStorage​(DataTranslation translation)
      Removes from the data translation storage the given data translation.
    • Method Detail

      • addToStorage

        void addToStorage​(DataTranslation translation)
        Adds to the data translation storage the given data translation.
      • getValue

        String getValue​(BaseEntity entity,
                        com.querydsl.core.types.dsl.StringPath path)
                 throws FrameworkException
        Returns the customized translation (or default value) for the given property of the given given entity, on the current language
        Throws:
        FrameworkException
      • getValue

        String getValue​(Language language,
                        BaseEntity entity,
                        String propertyName,
                        boolean fallbackToPropertyValue)
        Returns the customized translation (or default value) traversing the language's hierarchy for the tuple <language, entity, property>
      • getValue

        String getValue​(Language language,
                        BaseEntity entity,
                        String propertyName,
                        boolean fallbackToPropertyValue,
                        boolean traverseHierachy)
        Returns the customized translation for the tuple <language, entity, property>, optionally returning the default property value (if fallbackToPropertyValue is true and there is no such translation).
        The flag traverseHierachy is used to indicate if the language's hierarchy must be traversed (to the root) searching for translations.
      • removeFromStorage

        void removeFromStorage​(DataTranslation translation)
        Removes from the data translation storage the given data translation.