org.openbp.jaspira.decoration
Class DecorationMgr

java.lang.Object
  extended by org.openbp.jaspira.decoration.DecorationMgr

public class DecorationMgr
extends java.lang.Object

The decoration manager provides static methods that manage decorators. All decorators that are active in the system should run this this decoration manager. The decorationManager is an integral part of the JaspiraFramework

Author:
Stephan Moritz

Method Summary
static void addDecorator(Plugin provider, java.lang.String key, Decorator decorator)
          Adds a decorator to the list of decorators.
static java.lang.Object decorate(java.lang.Object owner, java.lang.String key, java.lang.Object value)
          Decorates an object.
static void removeDecorator(Plugin provider, java.lang.String key, Decorator decorator)
          Removes a decorator from the list of decorators.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

decorate

public static java.lang.Object decorate(java.lang.Object owner,
                                        java.lang.String key,
                                        java.lang.Object value)
Decorates an object.

Parameters:
owner - Owner of the object to decorate. The decorator may use this to decide if the object should be dorated. This parameter is passed to the Decorator.decorate(java.lang.Object, java.lang.String, java.lang.Object) method.
key - Key under which the decorator is accessed
value - Object to decorate (also passed to the Decorator.decorate(java.lang.Object, java.lang.String, java.lang.Object) method)
Returns:
The decorated object (or the original object if no decorator was active)

addDecorator

public static void addDecorator(Plugin provider,
                                java.lang.String key,
                                Decorator decorator)
Adds a decorator to the list of decorators.

Parameters:
provider - The plugin who installed this decorator or null. If provided, the global.decoration.added event will be fired.
key - Key under which the decorator is accessed
decorator - The decorator itself

removeDecorator

public static void removeDecorator(Plugin provider,
                                   java.lang.String key,
                                   Decorator decorator)
Removes a decorator from the list of decorators.

Parameters:
provider - The plugin who installed this decorator or null. If provided, the global.decoration.removed event will be fired.
key - Key under which the decorator has been added
decorator - The decorator itself


Copyright © 2011. All Rights Reserved.