public abstract class AbstractHandlerAndFilterDecorator extends AbstractDecorator
Filter
and
Handler
.
Implementors just have to implement the dedicated decorateFilter(Filter, JsonValue, Context)
and decorateHandler(Handler, JsonValue, Context)
for decorating Filter and Handler respectively.
Modifier | Constructor and Description |
---|---|
protected |
AbstractHandlerAndFilterDecorator(String name)
Forces to give the name of the decorator.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(Class<?> type)
Returns
true if this decorator is compatible with the provided component type. |
DecorationHandle |
decorate(Object delegate,
JsonValue decoratorConfig,
Context context)
Decorates the provided
delegate instance with the provided decoratorConfig configuration. |
protected abstract DecorationHandle |
decorateFilter(Filter delegate,
JsonValue decoratorConfig,
Context context)
|
protected abstract DecorationHandle |
decorateHandler(Handler delegate,
JsonValue decoratorConfig,
Context context)
|
getLogger
protected AbstractHandlerAndFilterDecorator(String name)
name
- The name of the decorator.public final boolean accepts(Class<?> type)
Decorator
true
if this decorator is compatible with the provided component type. Note that a return value
of true
does not necessarily indicate that decoration will be performed since it may also depend on other
factorstype
- type under testtrue
if the decorator can decorate instance of the given type, false
otherwise.public final DecorationHandle decorate(Object delegate, JsonValue decoratorConfig, Context context) throws HeapException
Decorator
delegate
instance with the provided decoratorConfig
configuration.
The implementation should take care of not changing the base type of the delegate.delegate
- instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instancenull
.HeapException
- when decoration failsprotected abstract DecorationHandle decorateHandler(Handler delegate, JsonValue decoratorConfig, Context context) throws HeapException
delegate
- Handler instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instanceHeapException
- when decoration failsprotected abstract DecorationHandle decorateFilter(Filter delegate, JsonValue decoratorConfig, Context context) throws HeapException
delegate
- Filter instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instanceHeapException
- when decoration failsCopyright 2011-2017 ForgeRock AS.