public abstract class AbstractHandlerAndFilterDecorator extends Object implements Decorator
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.
Constructor and Description |
---|
AbstractHandlerAndFilterDecorator() |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(Class<?> type)
Returns
true if this decorator is compatible with the provided component type. |
Object |
decorate(Object delegate,
JsonValue decoratorConfig,
Context context)
Decorates the provided
delegate instance with the provided decoratorConfig configuration. |
protected abstract Filter |
decorateFilter(Filter delegate,
JsonValue decoratorConfig,
Context context)
|
protected abstract Handler |
decorateHandler(Handler delegate,
JsonValue decoratorConfig,
Context context)
|
public AbstractHandlerAndFilterDecorator()
public 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
factorspublic Object 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.decorate
in interface Decorator
delegate
- instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instanceHeapException
- when decoration failsprotected abstract Filter 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 failsprotected abstract Handler 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 failsCopyright 2011-2015 ForgeRock AS.