Class DynamicI18NBeanFactory
java.lang.Object
com.atlassian.confluence.util.i18n.DynamicI18NBeanFactory
- All Implemented Interfaces:
I18NBeanFactory
Produces the best
I18NBean
s it can at the point it is first called upon.
This factory delegates to one of the following factories for the actual I18NBean
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
ConstructorsConstructorDescriptionDynamicI18NBeanFactory
(Supplier<Optional<org.springframework.beans.factory.BeanFactory>> setupBeanFactorySupplier) -
Method Summary
Modifier and TypeMethodDescription@NonNull I18NBean
@NonNull I18NBean
getI18NBean
(@NonNull Locale locale) @NonNull String
-
Constructor Details
-
DynamicI18NBeanFactory
-
DynamicI18NBeanFactory
public DynamicI18NBeanFactory()
-
-
Method Details
-
getI18NBean
- Specified by:
getI18NBean
in interfaceI18NBeanFactory
- Parameters:
locale
- locale for i18n- Returns:
- i18n bean for specified locale
-
getI18NBean
- Specified by:
getI18NBean
in interfaceI18NBeanFactory
- Returns:
- i18n bean for the system default locale
-
getStateHash
- Specified by:
getStateHash
in interfaceI18NBeanFactory
- Returns:
- a hash of the current state of this factory.
-