org.keel.comm
Class CommandMessage
java.lang.Object
org.keel.comm.AbstractMessageResponseElement
org.keel.comm.CommandMessage
- All Implemented Interfaces:
- Command, ResponseElement, java.io.Serializable
- public class CommandMessage
- extends AbstractMessageResponseElement
- implements Command, java.io.Serializable
Give the user a navigation option
- See Also:
- Serialized Form
| Method Summary |
ModelResponse |
execute(ModelRequest req, ModelResponse res)
Convenience method, equivilant to execute(req, res, false, false) |
ModelResponse |
execute(ModelRequest req, ModelResponse res, boolean includeParams, boolean includeResponseElements)
Execute the model specified by this command and return the model response. |
java.lang.String |
getLabel()
|
java.lang.String |
getModel()
Return the name of the model specified for this command, in the form it would appear in the configuration file |
java.util.Map |
getParameters()
Return a map of any parameter specified for this command |
int |
getRelativeMovement()
|
void |
setLabel(java.lang.String newLabel)
|
void |
setModel(java.lang.String newModel)
|
void |
setParameter(java.lang.String param, java.lang.Object value)
|
void |
setRelativeMovement(int numberOfSteps)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
params
private java.util.Map params
-
myModel
private java.lang.String myModel
-
myLabel
private java.lang.String myLabel
-
moveRelativeSteps
private int moveRelativeSteps
-
CommandMessage
public CommandMessage()
CommandMessage
public CommandMessage(Command c)
setModel
public void setModel(java.lang.String newModel)
-
- Specified by:
setModel in interface Command
-
getModel
public java.lang.String getModel()
- Description copied from interface:
Command
-
Return the name of the model specified for this command, in the form it would appear in the configuration file
-
- Specified by:
getModel in interface Command
-
setParameter
public void setParameter(java.lang.String param,
java.lang.Object value)
-
- Specified by:
setParameter in interface Command
-
getParameters
public java.util.Map getParameters()
- Description copied from interface:
Command
-
Return a map of any parameter specified for this command
-
- Specified by:
getParameters in interface Command
-
execute
public ModelResponse execute(ModelRequest req,
ModelResponse res)
throws ModelException
- Description copied from interface:
Command
-
Convenience method, equivilant to execute(req, res, false, false)
-
- Specified by:
execute in interface Command
-
- Throws:
ModelException
execute
public ModelResponse execute(ModelRequest req,
ModelResponse res,
boolean includeParams,
boolean includeResponseElements)
throws ModelException
- Description copied from interface:
Command
-
Execute the model specified by this command and return the model response.
-
- Specified by:
execute in interface Command
-
- Parameters:
req - The previous request. The model being will have this request available via it's getPreviousRequest method
res - The current response. The new response will always include any errors stored in this response, but will not include any response elements already generated unless includeResponseElements is true
includeParams - Include request parameters from the old request when building the new request. Normally, a command has it's parameters set via "setParameter", just like a request, and these are the only parameters used in the new request. If this flag is true, however, any parameters that exist in the current request and that have not been specified via setParameter are populated from the current request.
includeResponseElements - Include any response elements from the current response (res) in the newly generated response. If an element in the new response has the same name as an element in the current response, use the new one only.
- Throws:
ModelException
setLabel
public void setLabel(java.lang.String newLabel)
-
- Specified by:
setLabel in interface Command
-
getLabel
public java.lang.String getLabel()
-
- Specified by:
getLabel in interface Command
-
setRelativeMovement
public void setRelativeMovement(int numberOfSteps)
-
- Specified by:
setRelativeMovement in interface Command
-
getRelativeMovement
public int getRelativeMovement()
-
- Specified by:
getRelativeMovement in interface Command
-
Please see keelframework.org for information about new Keel releases.