Class GlobalDecorator
- java.lang.Object
-
- org.forgerock.openig.decoration.global.GlobalDecorator
-
-
Field Summary
Fields Modifier and Type Field Description static String
GLOBAL_DECORATOR_HEAP_KEY
Heap Key for the global decorator(s).
-
Constructor Summary
Constructors Constructor Description GlobalDecorator(Decorator parent, JsonValue config, Heap heap, String... reservedFieldNames)
Builds a new GlobalDecorator using given decorators JSON object element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(Class<?> type)
Returnstrue
if this decorator is compatible with the provided component type.DecorationHandle
decorate(Object delegate, JsonValue ignored, Context context)
Decorate the given object instance with the previously declared set of decorations instead of the provided one.
-
-
-
Field Detail
-
GLOBAL_DECORATOR_HEAP_KEY
public static final String GLOBAL_DECORATOR_HEAP_KEY
Heap Key for the global decorator(s). They may be local to each Heap.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GlobalDecorator
public GlobalDecorator(Decorator parent, JsonValue config, Heap heap, String... reservedFieldNames)
Builds a new GlobalDecorator using given decorators JSON object element.- Parameters:
parent
- the parent global decorator from which additional global decorators may be inherited. May benull
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 Detail
-
accepts
public boolean accepts(Class<?> type)
Description copied from interface:Decorator
Returnstrue
if this decorator is compatible with the provided component type. Note that a return value oftrue
does 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:
decorate
in 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
-
-