Interface ControllerRegistry
-
- All Superinterfaces:
Cloneable
- All Known Implementing Classes:
DefaultControllerRegistry
public interface ControllerRegistry extends Cloneable
A registry that holdsControllerAction
s.- Author:
- Jerry Vos
-
-
Field Summary
Fields Modifier and Type Field Description static ControllerAction
ACTION_TREE_ROOT
static String
DEFAULT_MASTER_CONTEXT_ID
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addAction(Object contextId, ControllerAction parent, ControllerAction action)
Adds an action to those for the specified context, under the specified parent action.void
addContextId(Object parentId, Object newId)
void
addParameterSetter(ParameterSetter paramInit)
ControllerRegistry
clone()
ControllerAction
findAction(Object contextID, String actionID)
Finds a registered action.Tree<ControllerAction>
getActionTree(Object contextTypeID)
Returns the root node for the tree of actions that occur for a specified context type.Tree<Object>
getContextIdTree()
Object
getMasterContextId()
String
getName()
Collection<ParameterSetter>
getParameterSetters()
void
registerAction(Object contextID, String id, ControllerAction action)
Registers an action so that it can be found later.boolean
removeAction(Object contextId, ControllerAction action)
Removes an action.void
removeContextId(Object id)
void
removeParameterSetter(ParameterSetter paramInit)
void
replaceAction(Object contextId, ControllerAction oldAction, ControllerAction newAction)
Replaces a given action with the specified action.void
replaceContextId(Object idToReplace, Object newId)
void
setMasterContextId(Object id)
void
setName(String name)
-
-
-
Field Detail
-
DEFAULT_MASTER_CONTEXT_ID
static final String DEFAULT_MASTER_CONTEXT_ID
- See Also:
- Constant Field Values
-
ACTION_TREE_ROOT
static final ControllerAction ACTION_TREE_ROOT
-
-
Method Detail
-
addAction
void addAction(Object contextId, ControllerAction parent, ControllerAction action)
Adds an action to those for the specified context, under the specified parent action.- Parameters:
parent
- the action under which this action occurs, if null, this is a child of the rootaction
- the action to add
-
removeAction
boolean removeAction(Object contextId, ControllerAction action)
Removes an action. Since the actions are stored as a tree, this has the side-effect of also removing all actions nested under the given action.- Parameters:
action
- the action to remove- Returns:
- if the action was removed, false if it was not in the registry
-
replaceAction
void replaceAction(Object contextId, ControllerAction oldAction, ControllerAction newAction)
Replaces a given action with the specified action. This will result in an action tree with the old action replaced with the new one. Any actions nested under the old action will now be nested under the new action. If the new action is aDefaultControllerAction
this is the same as removing the given action without removing its children. This will not accept null as an argument, as it would not make sense as either an old action or as the new one that is replacing it. If null is received anInvalidParameterException
will be thrown.- Parameters:
oldAction
- the action to replacenewAction
- the action with which to replace the old one
-
getActionTree
Tree<ControllerAction> getActionTree(Object contextTypeID)
Returns the root node for the tree of actions that occur for a specified context type.- Parameters:
contextTypeID
- the type id of the context who's action tree to return- Returns:
- the root node in the tree of actions
-
removeContextId
void removeContextId(Object id)
-
setMasterContextId
void setMasterContextId(Object id)
-
getMasterContextId
Object getMasterContextId()
-
getName
String getName()
-
setName
void setName(String name)
-
registerAction
void registerAction(Object contextID, String id, ControllerAction action)
Registers an action so that it can be found later.- Parameters:
contextID
-id
-action
-
-
findAction
ControllerAction findAction(Object contextID, String actionID)
Finds a registered action.- Parameters:
contextID
- the context of the actionactionID
- the id of the action- Returns:
- the found action
-
addParameterSetter
void addParameterSetter(ParameterSetter paramInit)
-
removeParameterSetter
void removeParameterSetter(ParameterSetter paramInit)
-
getParameterSetters
Collection<ParameterSetter> getParameterSetters()
-
clone
ControllerRegistry clone()
-
-