Class DefaultTranslationResolverFactory

java.lang.Object
de.chkal.mvctoolbox.core.translation.DefaultTranslationResolverFactory

@ApplicationScoped public class DefaultTranslationResolverFactory extends Object
Factory for initializing the default translation resolver for the Toolbox.
Author:
Tobias Erdle
See Also:
  • Constructor Details

    • DefaultTranslationResolverFactory

      public DefaultTranslationResolverFactory()
  • Method Details

    • getDefaultTranslationResolver

      @Produces @ApplicationScoped public TranslationResolver getDefaultTranslationResolver(jakarta.mvc.MvcContext mvcContext)
      Produce the default TranslationResolver for the Toolbox. This will be an @ApplicationScoped PropertiesTranslationResolver which points at a resource bundle named 'messages' in the projects resources root. This will match for the most applications.

      In case an application needs a more advanced setup or custom TranslationResolvers, an additional factory with producer methods can be created.

      Parameters:
      mvcContext - the MvcContext of the current request
      Returns:
      the default PropertiesTranslationResolver for the Toolbox bean