public class ActionsManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ActionMethodParser |
actionMethodParser |
protected int |
actionsCount |
protected boolean |
asyncMode |
protected boolean |
detectDuplicatePathsEnabled |
protected java.util.Map<java.lang.String,java.lang.String> |
pathAliases |
protected java.lang.String[] |
pathExtensionsToStrip |
protected java.lang.Class<? extends PathMacros> |
pathMacroClass |
protected java.lang.String[] |
pathMacroSeparators |
protected Routes |
routes |
protected java.util.HashMap<java.lang.String,ActionRuntime> |
runtimes |
protected boolean |
strictRoutePaths |
Constructor and Description |
---|
ActionsManager() |
Modifier and Type | Method and Description |
---|---|
int |
getActionsCount()
Returns total number of registered actions.
|
java.util.List<ActionRuntime> |
getAllActionRuntimes()
Returns all registered action runtime configurations.
|
java.util.Map<java.lang.String,java.lang.String> |
getAllAliases() |
java.lang.String[] |
getPathExtensionsToStrip() |
java.lang.Class<? extends PathMacros> |
getPathMacroClass()
Returns current implementation for path macros.
|
java.lang.String[] |
getPathMacroSeparators() |
boolean |
isAsyncModeOn()
Returns
true if at least one action has
async mode turned on. |
boolean |
isDetectDuplicatePathsEnabled() |
boolean |
isStrictRoutePaths() |
ActionRuntime |
lookup(java.lang.String actionString)
Lookups action runtime config for given action class and method string (aka 'action string').
|
ActionRuntime |
lookup(java.lang.String method,
java.lang.String[] actionPath) |
java.lang.String |
lookupPathAlias(java.lang.String alias)
Returns path alias.
|
ActionRuntime |
registerAction(java.lang.Class actionClass,
java.lang.reflect.Method actionMethod,
ActionDefinition actionDefinition)
Registration main point.
|
ActionRuntime |
registerAction(java.lang.Class actionClass,
java.lang.String actionMethodName,
ActionDefinition actionDefinition)
Registers action with provided action class and method name.
|
ActionRuntime |
registerActionRuntime(ActionRuntime actionRuntime)
Registers manually created
action runtime configurations . |
void |
registerPathAlias(java.lang.String alias,
java.lang.String path)
Registers new path alias.
|
java.lang.reflect.Method |
resolveActionMethod(java.lang.Class<?> actionClass,
java.lang.String methodName)
Resolves action method for given action class ane method name.
|
void |
setDetectDuplicatePathsEnabled(boolean detectDuplicatePathsEnabled) |
void |
setPathExtensionsToStrip(java.lang.String... pathExtensionsToStrip) |
void |
setPathMacroClass(java.lang.Class<? extends PathMacros> pathMacroClass)
Sets implementation for path macros.
|
void |
setPathMacroSeparators(java.lang.String... pathMacroSeparators)
Sets path macro separators.
|
void |
setStrictRoutePaths(boolean strictRoutePaths)
Defines if the router should trim parts of the path to match the action path.
|
@PetiteInject protected ActionMethodParser actionMethodParser
protected int actionsCount
protected boolean asyncMode
protected final Routes routes
protected final java.util.HashMap<java.lang.String,ActionRuntime> runtimes
protected java.util.Map<java.lang.String,java.lang.String> pathAliases
protected boolean detectDuplicatePathsEnabled
protected java.lang.Class<? extends PathMacros> pathMacroClass
protected java.lang.String[] pathMacroSeparators
protected boolean strictRoutePaths
protected java.lang.String[] pathExtensionsToStrip
public java.util.List<ActionRuntime> getAllActionRuntimes()
public java.util.Map<java.lang.String,java.lang.String> getAllAliases()
public int getActionsCount()
public boolean isAsyncModeOn()
true
if at least one action has
async mode turned on.public java.lang.reflect.Method resolveActionMethod(java.lang.Class<?> actionClass, java.lang.String methodName)
public ActionRuntime registerAction(java.lang.Class actionClass, java.lang.String actionMethodName, ActionDefinition actionDefinition)
public ActionRuntime registerAction(java.lang.Class actionClass, java.lang.reflect.Method actionMethod, ActionDefinition actionDefinition)
parse action
and creates ActionRuntime
registers
created ActionRuntime
ActionRuntime
.registerActionRuntime(ActionRuntime)
public ActionRuntime registerActionRuntime(ActionRuntime actionRuntime)
action runtime configurations
.
Optionally, if action path with the same name already exist,
exception will be thrown.public ActionRuntime lookup(java.lang.String method, java.lang.String[] actionPath)
public ActionRuntime lookup(java.lang.String actionString)
className#methodName
.ActionRuntime.createActionString()
public void registerPathAlias(java.lang.String alias, java.lang.String path)
public java.lang.String lookupPathAlias(java.lang.String alias)
public java.lang.Class<? extends PathMacros> getPathMacroClass()
public void setPathMacroClass(java.lang.Class<? extends PathMacros> pathMacroClass)
public java.lang.String[] getPathMacroSeparators()
public void setPathMacroSeparators(java.lang.String... pathMacroSeparators)
public boolean isDetectDuplicatePathsEnabled()
public void setDetectDuplicatePathsEnabled(boolean detectDuplicatePathsEnabled)
public boolean isStrictRoutePaths()
public void setStrictRoutePaths(boolean strictRoutePaths)
public java.lang.String[] getPathExtensionsToStrip()
public void setPathExtensionsToStrip(java.lang.String... pathExtensionsToStrip)
Copyright © 2003-present Jodd Team