Class DynamicI18NBeanFactory
- java.lang.Object
-
- com.atlassian.confluence.util.i18n.DynamicI18NBeanFactory
-
- All Implemented Interfaces:
I18NBeanFactory
public class DynamicI18NBeanFactory extends Object implements I18NBeanFactory
Produces the bestI18NBeans it can at the point it is first called upon. This factory delegates to one of the following factories for the actualI18NBeancreation:- If the container manager is set up the
UserI18NBeanFactorywill be used - If the container manager is not set up, attempt to obtain a reference to the "i18NBeanFactory" bean,
which refers to either a
CachingI18NBeanFactoryor aDefaultI18NBeanFactory, depending on the context. - Otherwise the call will be delegated to the no arg
DefaultI18NBeanFactorywhich will provide translations in the default locale
-
-
Constructor Summary
Constructors Constructor Description DynamicI18NBeanFactory()DynamicI18NBeanFactory(Supplier<Optional<org.springframework.beans.factory.BeanFactory>> setupBeanFactorySupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull I18NBeangetI18NBean()@NonNull I18NBeangetI18NBean(@NonNull Locale locale)@NonNull StringgetStateHash()
-
-
-
Method Detail
-
getI18NBean
public @NonNull I18NBean getI18NBean(@NonNull Locale locale)
- Specified by:
getI18NBeanin interfaceI18NBeanFactory- Parameters:
locale- locale for i18n- Returns:
- i18n bean for specified locale
-
getI18NBean
public @NonNull I18NBean getI18NBean()
- Specified by:
getI18NBeanin interfaceI18NBeanFactory- Returns:
- i18n bean for the system default locale
-
getStateHash
public @NonNull String getStateHash()
- Specified by:
getStateHashin interfaceI18NBeanFactory- Returns:
- a hash of the current state of this factory.
-
-