Class GlobalDecorator
java.lang.Object
org.forgerock.openig.decoration.global.GlobalDecorator
- All Implemented Interfaces:
Decorator
A GlobalDecorator stores decorators configuration in order to re-apply them when requested
to decorate a given heap object instance.
-
Constructor Summary
ConstructorsConstructorDescriptionGlobalDecorator(JsonValue config, Heap heap, String... reservedFieldNames) Builds a new GlobalDecorator using given decorators JSON object element. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif this decorator is compatible with the provided component type.Decorate the given object instance with the previously declared set of decorations instead of the provided one.
-
Constructor Details
-
GlobalDecorator
Builds a new GlobalDecorator using given decorators JSON object element.- Parameters:
config- a JSON configurationheap- the heap where this global decorator is declared (nevernull)reservedFieldNames- the names of reserved top level fields in the config which
-
-
Method Details
-
accepts
Description copied from interface:DecoratorReturnstrueif this decorator is compatible with the provided component type. Note that a return value oftruedoes not necessarily indicate that decoration will be performed since it may also depend on other factors -
decorate
public DecorationHandle decorate(Object delegate, JsonValue ignored, Context context) throws HeapException Decorate the given object instance with the previously declared set of decorations instead of the provided one.- Specified by:
decoratein interfaceDecorator- Parameters:
delegate- instance to decorateignored- ignored (may probably benull)context- Context of the heap object to be decorated- Returns:
- the decorated instance or the original delegate (if no decorator could apply)
- Throws:
HeapException- if one of the decorator failed to decorate the instance
-