org.keel.services.model.defaultmodel
Class DefaultCommand
java.lang.Object
org.keel.services.model.defaultmodel.AbstractResponseElement
org.keel.services.model.defaultmodel.DefaultCommand
- All Implemented Interfaces:
- Command, ResponseElement
- public class DefaultCommand
- extends AbstractResponseElement
- implements Command
Give the user a navigation option
| 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)
Specify the name of the model this command will execute |
void |
setParameter(java.lang.String param, java.lang.Object value)
|
void |
setRelativeMovement(int numberOfSteps)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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
-
DefaultCommand
public DefaultCommand()
setModel
public void setModel(java.lang.String newModel)
-
Specify the name of the model this command will execute
-
- Specified by:
setModel in interface Command
-
- Parameters:
newModel - The name (the logical configuration name) of the model that will be executed by this 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
-
toString
public java.lang.String toString()
-
- Overrides:
toString in class AbstractResponseElement
-
Please see keelframework.org for information about new Keel releases.