public abstract class DecoratorMulti18nProvider extends Object
loadDecorators(Locale)
to fill the decorators
availables.
Then can obtain decorator via the methods getDecorator(...)
Modifier and Type | Class and Description |
---|---|
static class |
DecoratorMulti18nProvider.DecoratorContext<T> |
Modifier and Type | Field and Description |
---|---|
protected Map<Locale,Collection<DecoratorMulti18nProvider.DecoratorContext<?>>> |
decoratorContexts
Loaded decorators.
|
Constructor and Description |
---|
DecoratorMulti18nProvider() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
<O> Decorator<O> |
getDecorator(Locale locale,
O object)
Obtain a decorator for the given object using the given
locale . |
<O> Decorator<O> |
getDecorator(Locale locale,
O object,
String name)
Obtain a decorator given a object and an extra name to qualify the
context using the given
locale . |
<O> Decorator<O> |
getDecoratorByType(Locale locale,
Class<O> type)
Obtain a decorator given a type on the given
locale . |
<O> Decorator<O> |
getDecoratorByType(Locale locale,
Class<O> type,
String name)
Obtain a decorator given a type and a extra context name on the given
locale . |
protected <T> DecoratorMulti18nProvider.DecoratorContext<T> |
getDecoratorContext(Locale locale,
Class<T> type,
String context,
boolean doLoad) |
protected Map<Locale,Collection<DecoratorMulti18nProvider.DecoratorContext<?>>> |
getDecoratorContexts() |
protected Collection<DecoratorMulti18nProvider.DecoratorContext<?>> |
getDecoratorContexts(Locale locale,
boolean doLoad) |
protected abstract void |
loadDecorators(Locale locale)
Load all decorators of the provider for the given
locale . |
void |
registerDecorator(Locale locale,
Decorator<?> decorator) |
<T> void |
registerDecorator(Locale locale,
String context,
Decorator<T> decorator)
Register a new decorator in the cache of the provider.
|
void |
registerJXPathDecorator(Locale locale,
Class<?> klass,
String expression) |
void |
registerJXPathDecorator(Locale locale,
Class<?> klass,
String name,
String expression) |
void |
registerMultiJXPathDecorator(Locale locale,
Class<?> klass,
String expression,
String separator,
String separatorReplacement) |
void |
registerMultiJXPathDecorator(Locale locale,
Class<?> klass,
String name,
String expression,
String separator,
String separatorReplacement) |
void |
registerPropertyDecorator(Locale locale,
Class<?> klass,
String expression) |
void |
registerPropertyDecorator(Locale locale,
Class<?> klass,
String name,
String expression) |
protected Map<Locale,Collection<DecoratorMulti18nProvider.DecoratorContext<?>>> decoratorContexts
getDecoratorContexts(Locale, boolean)
.protected abstract void loadDecorators(Locale locale)
locale
.locale
- the locale to use to load decorators.public <O> Decorator<O> getDecorator(Locale locale, O object)
locale
.O
- object of decorated objectlocale
- user localeobject
- object of decorated objectnull
if not foundpublic <O> Decorator<O> getDecorator(Locale locale, O object, String name)
locale
.O
- object of decorated objectlocale
- user localeobject
- object of decorated objectname
- extra name to qualify the decorator to usenull
if not foundpublic <O> Decorator<O> getDecoratorByType(Locale locale, Class<O> type)
locale
.O
- type of decorated objectlocale
- user localetype
- type of decorated objectnull
if not foundpublic <O> Decorator<O> getDecoratorByType(Locale locale, Class<O> type, String name)
locale
.O
- type of decorated objectlocale
- user localetype
- type of decorated objectname
- extra name to qualify the decorator to usenull
if not foundpublic void registerPropertyDecorator(Locale locale, Class<?> klass, String expression)
public void registerJXPathDecorator(Locale locale, Class<?> klass, String expression)
public void registerMultiJXPathDecorator(Locale locale, Class<?> klass, String expression, String separator, String separatorReplacement)
public void registerPropertyDecorator(Locale locale, Class<?> klass, String name, String expression)
public void registerJXPathDecorator(Locale locale, Class<?> klass, String name, String expression)
public void registerMultiJXPathDecorator(Locale locale, Class<?> klass, String name, String expression, String separator, String separatorReplacement)
public <T> void registerDecorator(Locale locale, String context, Decorator<T> decorator)
T
- type of data decoratedlocale
- the given locale to use for this decoratorcontext
- the name decoratordecorator
- the decorator to registerpublic void clear()
protected Map<Locale,Collection<DecoratorMulti18nProvider.DecoratorContext<?>>> getDecoratorContexts()
protected Collection<DecoratorMulti18nProvider.DecoratorContext<?>> getDecoratorContexts(Locale locale, boolean doLoad)
protected <T> DecoratorMulti18nProvider.DecoratorContext<T> getDecoratorContext(Locale locale, Class<T> type, String context, boolean doLoad)
Copyright © 2013–2015 CodeLutin. All rights reserved.