Class DynamicI18NBeanFactory
- java.lang.Object
-
- com.atlassian.confluence.util.i18n.DynamicI18NBeanFactory
-
- All Implemented Interfaces:
I18NBeanFactory
public class DynamicI18NBeanFactory extends Object implements I18NBeanFactory
Produces the bestI18NBean
s it can at the point it is first called upon. This factory delegates to one of the following factories for the actualI18NBean
creation:- If the container manager is set up the
UserI18NBeanFactory
will be used - If the container manager is not set up, attempt to obtain a reference to the "i18NBeanFactory" bean,
which refers to either a
CachingI18NBeanFactory
or aDefaultI18NBeanFactory
, depending on the context. - Otherwise the call will be delegated to the no arg
DefaultI18NBeanFactory
which 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 I18NBean
getI18NBean()
@NonNull I18NBean
getI18NBean(@NonNull Locale locale)
@NonNull String
getStateHash()
-
-
-
Method Detail
-
getI18NBean
public @NonNull I18NBean getI18NBean(@NonNull Locale locale)
- Specified by:
getI18NBean
in interfaceI18NBeanFactory
- Parameters:
locale
- locale for i18n- Returns:
- i18n bean for specified locale
-
getI18NBean
public @NonNull I18NBean getI18NBean()
- Specified by:
getI18NBean
in interfaceI18NBeanFactory
- Returns:
- i18n bean for the system default locale
-
getStateHash
public @NonNull String getStateHash()
- Specified by:
getStateHash
in interfaceI18NBeanFactory
- Returns:
- a hash of the current state of this factory.
-
-