|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.dandelion.datatables.core.configuration.StandardConfigurationLoader
public class StandardConfigurationLoader
Default implementation of the ConfigurationLoader.
Note that a custom ConfigurationLoader can be used thanks to the
DatatablesConfigurator.
DatatablesConfigurator| Field Summary | |
|---|---|
protected static Properties |
defaultProperties
|
| Fields inherited from interface com.github.dandelion.datatables.core.configuration.ConfigurationLoader |
|---|
DEFAULT_GROUP_NAME, DT_DEFAULT_PROPERTIES, DT_USER_PROPERTIES, DT_USER_PROPERTIES_LOCATION, I18N_LOCALE_RESOLVER, I18N_MESSAGE_RESOLVER, STANDALONE_BUNDLES_TO_EXCLUDE |
| Constructor Summary | |
|---|---|
StandardConfigurationLoader()
|
|
| Method Summary | |
|---|---|
Properties |
loadDefaultConfiguration()
Load the default configuration from the internal properties file and both: stores the properties inside a class field returns the properties if they need to be used outside of the class |
Properties |
loadUserConfiguration(Locale locale)
Load the user configuration which can be localized thanks to the given locale. |
void |
resolveConfigurations(Map<String,Map<ConfigToken<?>,Object>> map,
Locale locale,
javax.servlet.http.HttpServletRequest request)
Resolve configuration groups for the given locale. |
Set<String> |
resolveGroups(Locale locale)
Return a set containing all configuration groups. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Properties defaultProperties
| Constructor Detail |
|---|
public StandardConfigurationLoader()
| Method Detail |
|---|
public Properties loadDefaultConfiguration()
Load the default configuration from the internal properties file and both:
loadDefaultConfiguration in interface ConfigurationLoaderpublic Properties loadUserConfiguration(Locale locale)
Load the user configuration which can be localized thanks to the given locale.
Once the bundle loaded, it is converted into Properties.
loadUserConfiguration in interface ConfigurationLoaderlocale - The current locale used to load the right properties file.
public Set<String> resolveGroups(Locale locale)
Return a set containing all configuration groups.
Note that the i18n.locale.resolver is a special property
that must not be taken into account because it is group-independent.
resolveGroups in interface ConfigurationLoaderlocale - The current locale.
public void resolveConfigurations(Map<String,Map<ConfigToken<?>,Object>> map,
Locale locale,
javax.servlet.http.HttpServletRequest request)
Resolve configuration groups for the given locale.
The default properties file (datatables-default.properties) already contains the 'global' group: this is the group of configuration that is used for all tables in the application.
Inside the user properties files (datatables_XX.properties), users can:
global.
For example, if the user properties file contains:
group1.i18n.msg.search=My label
group1.i18n.msg.processing=My other label
the ConfigurationLoader must create a group called 'group1'
containing all properties present in the 'global' group but where
i18n.msg.search and i18n.msg.processing are
overriden with the user's ones.
Note that:
resolveConfigurations in interface ConfigurationLoadermap - The map to update after the resolution of the configuration
groups.locale - The current locale used to get the right properties file from
the resource bundle.request - The request sent by the browser.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||