org.japano.action
Class ActionConfig

java.lang.Object
  extended by org.japano.action.ActionConfig
All Implemented Interfaces:
java.io.Serializable

public class ActionConfig
extends java.lang.Object
implements java.io.Serializable

This is the root class for the japano action mapping configuration which is created and updated by the metadata processor. The configuration is persisted under /WEB-INF/japano-actionMap.ser.

Version:
$Id: ActionConfig.java,v 1.5 2005/10/12 20:15:14 fforw Exp $ SourceForge.net Logo
Author:
Sven Helmberger ( sven dot helmberger at gmx dot de )
See Also:
Serialized Form

Field Summary
static java.lang.String ACTIONCOUNT_PARAMETER_NAME
          name of the action count parameter
static java.lang.String FILENAME
          file name of the actionMap file
static java.lang.String SHOWVIEW_URI
           
 
Constructor Summary
ActionConfig()
           
 
Method Summary
 void addAction(ActionMapping action)
          Adds the given ActionConfig to this ActionMap.
 Action createAction(java.lang.String qName)
          Creates the action instance mapped to the given qualified name.
 ActionMapping getActionFromTag(java.lang.String library, java.lang.String name)
          Returns the ActionConfig instance of the action which is linked to the given tag in the given library.
 ActionMapping getActionMapping(java.lang.String qName)
          Returns the action mapping for the given qualified name.
 ActionMapping getActionMappingForURI(java.lang.String uri)
          Returns the action which is mapped to the URI or null.
 java.lang.String getQualifiedName(java.lang.Class actionClass)
          Returns the qualified name the action class is mapped to.
static ActionConfig read(java.lang.String path)
          Reads an ActionMap from the given path.
 void redirectTo(javax.servlet.http.HttpServletResponse response, java.lang.Class actionClass)
          Sends a redirect to the given action.
 int size()
          Returns the number of actions configured in this ActionMap.
 java.lang.String toString()
           
 void write(java.lang.String path)
          Writes this ActionMap to the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SHOWVIEW_URI

public static final java.lang.String SHOWVIEW_URI
See Also:
Constant Field Values

ACTIONCOUNT_PARAMETER_NAME

public static final java.lang.String ACTIONCOUNT_PARAMETER_NAME
name of the action count parameter

See Also:
Constant Field Values

FILENAME

public static final java.lang.String FILENAME
file name of the actionMap file

See Also:
Constant Field Values
Constructor Detail

ActionConfig

public ActionConfig()
Method Detail

getActionFromTag

public ActionMapping getActionFromTag(java.lang.String library,
                                      java.lang.String name)
Returns the ActionConfig instance of the action which is linked to the given tag in the given library.

Parameters:
library - URI of the library
name - of the tag
Returns:
ActionConfig or null

addAction

public void addAction(ActionMapping action)
Adds the given ActionConfig to this ActionMap.

Parameters:
action - ActionConfig

getActionMappingForURI

public ActionMapping getActionMappingForURI(java.lang.String uri)
Returns the action which is mapped to the URI or null.

Parameters:
uri - URI
Returns:
action mapping

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

createAction

public Action createAction(java.lang.String qName)
Creates the action instance mapped to the given qualified name.

Parameters:
qName - qualified name
Returns:
action instance

read

public static ActionConfig read(java.lang.String path)
Reads an ActionMap from the given path.

Parameters:
path - full path of a .ser file
Returns:
deserialized ActionMap

write

public void write(java.lang.String path)
Writes this ActionMap to the given file.

Parameters:
path - full path of a .ser file

size

public int size()
Returns the number of actions configured in this ActionMap.

Returns:
number of actions

getQualifiedName

public java.lang.String getQualifiedName(java.lang.Class actionClass)
Returns the qualified name the action class is mapped to.

Parameters:
actionClass - action class to get the qualified name for
Returns:
qualified name

redirectTo

public void redirectTo(javax.servlet.http.HttpServletResponse response,
                       java.lang.Class actionClass)
                throws java.io.IOException
Sends a redirect to the given action.

Parameters:
response - HttpServletResponse to send redirect with.
actionClass - Class of the action to be redirected to. Must implement Action
Throws:
java.io.IOException

getActionMapping

public ActionMapping getActionMapping(java.lang.String qName)
Returns the action mapping for the given qualified name.

Parameters:
qName - qualified name
Returns:
action mapping or null