public abstract class DecoratorProvider extends Object
loadDecorators()
to fill the decorators
availables.
Then can obtain decorator via the methods getDecorator(...)
Modifier and Type | Class and Description |
---|---|
static class |
DecoratorProvider.DecoratorContext<T> |
Modifier and Type | Field and Description |
---|---|
protected List<DecoratorProvider.DecoratorContext<?>> |
decorators
Registred decorators.
|
Constructor and Description |
---|
DecoratorProvider() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
<O> Decorator<O> |
getDecorator(O object)
Obtain a decorator for the given object.
|
<O> Decorator<O> |
getDecorator(O object,
String name)
Obtain a decorator given a object and an extra name to qualify the
context.
|
<O> Decorator<O> |
getDecoratorByType(Class<O> type)
Obtain a decorator given a type.
|
<O> Decorator<O> |
getDecoratorByType(Class<O> type,
String name)
Obtain a decorator given a type and a extra name.
|
protected <T> DecoratorProvider.DecoratorContext<T> |
getDecoratorContext(Class<T> type,
String context) |
protected List<DecoratorProvider.DecoratorContext<?>> |
getDecorators() |
protected abstract void |
loadDecorators()
Load all decorators of the provider
|
void |
registerDecorator(Decorator<?> decorator) |
<T> void |
registerDecorator(String context,
Decorator<T> decorator)
Register a new decorator in the cache of the provider.
|
void |
registerJXPathDecorator(Class<?> klass,
String expression) |
void |
registerJXPathDecorator(Class<?> klass,
String name,
String expression) |
void |
registerMultiJXPathDecorator(Class<?> klass,
String expression,
String separator,
String separatorReplacement) |
void |
registerMultiJXPathDecorator(Class<?> klass,
String name,
String expression,
String separator,
String separatorReplacement) |
void |
registerPropertyDecorator(Class<?> klass,
String expression) |
void |
registerPropertyDecorator(Class<?> klass,
String name,
String expression) |
void |
reload() |
protected List<DecoratorProvider.DecoratorContext<?>> decorators
protected abstract void loadDecorators()
public <O> Decorator<O> getDecorator(O object)
O
- object of decorated objectobject
- object of decorated objectnull
if not foundpublic <O> Decorator<O> getDecorator(O object, String name)
O
- object of decorated objectobject
- object of decorated objectname
- extra name to qualify the decorator to usenull
if not foundpublic <O> Decorator<O> getDecoratorByType(Class<O> type)
O
- type of decorated objecttype
- type of decorated objectnull
if not foundpublic <O> Decorator<O> getDecoratorByType(Class<O> type, String name)
O
- type of decorated objecttype
- type of decorated objectname
- extra name to qualify the decorator to usenull
if not foundpublic void reload()
public void registerMultiJXPathDecorator(Class<?> klass, String expression, String separator, String separatorReplacement)
public void registerPropertyDecorator(Class<?> klass, String name, String expression)
public void registerJXPathDecorator(Class<?> klass, String name, String expression)
public void registerMultiJXPathDecorator(Class<?> klass, String name, String expression, String separator, String separatorReplacement)
public void registerDecorator(Decorator<?> decorator)
public <T> void registerDecorator(String context, Decorator<T> decorator)
T
- type of data decoratedcontext
- the name decoratordecorator
- the decorator to registerpublic void clear()
protected List<DecoratorProvider.DecoratorContext<?>> getDecorators()
protected <T> DecoratorProvider.DecoratorContext<T> getDecoratorContext(Class<T> type, String context)
Copyright © 2013–2015 CodeLutin. All rights reserved.