HDIV API 2.0.4

org.hdiv.state
Class State

java.lang.Object
  extended by org.hdiv.state.State
All Implemented Interfaces:
java.io.Serializable, IState

public class State
extends java.lang.Object
implements IState, java.io.Serializable

Data structure to store all data related with one request (parameters, parameter values, ...)

Author:
Roberto Velasco
See Also:
Serialized Form

Constructor Summary
State()
          Creates a new State object with a new parameters map and a new required parameters map.
 
Method Summary
 void addParameter(java.lang.String key, IParameter parameter)
          Adds a new parameter to the state this.
 boolean existParameter(java.lang.String key)
          Checks if exists a parameter with the given identifier key.
 java.lang.String getAction()
           
 java.lang.String getId()
           
 java.lang.String getPageId()
           
 IParameter getParameter(java.lang.String key)
          Returns the parameter that matches the given identifier key.
 java.util.Map getParameters()
           
 java.util.Hashtable getRequiredParams()
           
 void setAction(java.lang.String action)
           
 void setId(java.lang.String id)
           
 void setPageId(java.lang.String pageId)
           
 void setParameters(java.util.Map parameters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

State

public State()
Creates a new State object with a new parameters map and a new required parameters map.

Method Detail

addParameter

public void addParameter(java.lang.String key,
                         IParameter parameter)
Adds a new parameter to the state this. If it is a required parameter parameter, it is also added to the required parameters map.

Specified by:
addParameter in interface IState
Parameters:
key - new parameter identifier
parameter - The parameter

existParameter

public boolean existParameter(java.lang.String key)
Checks if exists a parameter with the given identifier key.

Specified by:
existParameter in interface IState
Parameters:
key - parameter identifier
Returns:
True if exists a parameter with this identifier key. False otherwise.

getParameter

public IParameter getParameter(java.lang.String key)
Returns the parameter that matches the given identifier key.

Specified by:
getParameter in interface IState
Parameters:
key - parameter identifier
Returns:
IParameter object that matches the given identifier key.

getAction

public java.lang.String getAction()
Specified by:
getAction in interface IState
Returns:
Returns the action asociated to state this.

setAction

public void setAction(java.lang.String action)
Specified by:
setAction in interface IState
Parameters:
action - The action to set.

getParameters

public java.util.Map getParameters()
Specified by:
getParameters in interface IState
Returns:
Returns the parameters asociated to state this.

setParameters

public void setParameters(java.util.Map parameters)
Parameters:
parameters - The parameters to set.

getId

public java.lang.String getId()
Specified by:
getId in interface IState
Returns:
Returns the this id.

setId

public void setId(java.lang.String id)
Specified by:
setId in interface IState
Parameters:
id - The id to set.

getPageId

public java.lang.String getPageId()
Specified by:
getPageId in interface IState
Returns:
Returns the page identifier which the state this belongs to.

setPageId

public void setPageId(java.lang.String pageId)
Specified by:
setPageId in interface IState
Parameters:
pageId - The pageId to set.

getRequiredParams

public java.util.Hashtable getRequiredParams()
Specified by:
getRequiredParams in interface IState
Returns:
Returns required parameters map.

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.