public interface Decorator
A Decorator cannot change the base type of the provided delegate: for example
if the given instance is a Filter
, the decorated (and returned)
instance must also be a Filter
, sub-classing is ok though.
Decorators may be "global" to a heap or "local" to a component. Global decorators are applied to all components within the heap and any child heaps. Local decorators are only applied to their associated component. Decorators are applied such that inherited global decorators are applied first, then global decorators from the current heap, and finally local decorators. This means that requests will pass through decorators in the order local decorators, then global decorators, then inherited global decorators.
Notice: This API is still considered experimental and is subject to change in subsequent releases.
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,
org.forgerock.json.JsonValue decoratorConfig,
Context context)
Decorates the provided
delegate instance with the provided decoratorConfig configuration. |
boolean accepts(Class<?> type)
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.Object decorate(Object delegate, org.forgerock.json.JsonValue decoratorConfig, Context context) throws HeapException
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 instanceHeapException
- when decoration failsCopyright © 2025 Open Identity Platform Community. All rights reserved.