*
type - Class name of the Action class used by this ActionMapping.
*
* name - Name of the ActionForm class, if any, associated with this
* Action.
* input - Path of the input form to which control should be
* returned if a validation error is encountered.
* validate - Set to 1 if the validate() method of the ActionForm
* class (if any) associated with this ActionMapping should be called. [0]
*
*
* @author Arnold Cano
* @version $Id: ActionMapping.php,v 1.1.1.1 2004-06-16 12:25:44 cvs Exp $
*/
class ActionMapping extends HashMap
{
/**
* @var string
*/
var $_type;
/**
* @var string
*/
var $_name;
/**
* @var string
*/
var $_input;
/**
* @var string
*/
var $_validate = 0;
/**
* Create a ActionMapping with the specified values.
*
* @access public
* @param string $name
* @param array $mapping
*/
function ActionMapping($name, $mapping)
{
$this->setType($mapping[_TYPE]);
$this->setName($name);
$this->setInput($mapping[_INPUT]);
$this->setValidate($mapping[_VALIDATE]);
if (is_array($mapping[_ACTION_FORWARDS])) {
$this->_initActionForwards($mapping[_ACTION_FORWARDS]);
}
}
/**
* Initialize the ActionForwards array associated with this
* ActionMapping.
*
* @access private
* @param array $forwards
*/
function _initActionForwards($forwards)
{
foreach ($forwards as $name => $forward) {
$actionForward = new ActionForward($name, $forward);
$this->put($name, $actionForward);
}
}
/**
* Get the type of the ActionForward.
*
* @access public
* @return string
*/
function getType()
{
return $this->_type;
}
/**
* Set the type of the ActionForward.
*
* @access public
* @param string $type
*/
function setType($type)
{
$this->_type = $type;
}
/**
* Get the name of the ActionForward.
*
* @access public
* @return string
*/
function getName()
{
return $this->_name;
}
/**
* Set the name of the ActionForward.
*
* @access public
* @param string $name
*/
function setName($name)
{
$this->_name = $name;
}
/**
* Get the input URI of the ActionForward.
*
* @access public
* @return string
*/
function getInput()
{
return $this->_input;
}
/**
* Set the input URI of the ActionForward.
*
* @access public
* @param string $input
*/
function setInput($input)
{
$this->_input = $input;
}
/**
* Get the validate flag of the ActionForward.
*
* @access public
* @return integer
*/
function getValidate()
{
return $this->_validate;
}
/**
* Set the validate flag of the ActionForward.
*
* @access public
* @param string $validate
*/
function setValidate($validate)
{
$this->_validate = $validate;
}
}
?>