com.google.code.rees.scope.struts2
Class ModelDrivenConversationSupport<T extends Serializable>

java.lang.Object
  extended by com.opensymphony.xwork2.ActionSupport
      extended by com.google.code.rees.scope.struts2.ModelDrivenConversationSupport<T>
Type Parameters:
T -
All Implemented Interfaces:
com.opensymphony.xwork2.Action, com.opensymphony.xwork2.LocaleProvider, com.opensymphony.xwork2.ModelDriven<T>, com.opensymphony.xwork2.TextProvider, com.opensymphony.xwork2.Validateable, com.opensymphony.xwork2.ValidationAware, Serializable

public abstract class ModelDrivenConversationSupport<T extends Serializable>
extends com.opensymphony.xwork2.ActionSupport
implements com.opensymphony.xwork2.ModelDriven<T>

This class makes it simple to manage models with conversation-scoped life-cycles. It can be used in place of the ConversationController annotation for people who hate annotations/meta-data. All access to the model is through the getModel() and setModel(Serializable) methods so that retrieval and insertion of the model from and into conversation instances can be managed on behalf of inheriting classes.

Author:
rees.byars
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.opensymphony.xwork2.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork2.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
ModelDrivenConversationSupport()
           
 
Method Summary
 T getModel()
           The model is scoped to the conversations associated with the current request and action.
protected  String getModelName()
          The name of the model used to identify it in the ConversationContext.
 void setModel(T model)
          Set the model.
 
Methods inherited from class com.opensymphony.xwork2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, doDefault, execute, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getFormatted, getLocale, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelDrivenConversationSupport

public ModelDrivenConversationSupport()
Method Detail

getModel

public T getModel()
The model is scoped to the conversations associated with the current request and action.

Specified by:
getModel in interface com.opensymphony.xwork2.ModelDriven<T extends Serializable>

setModel

public void setModel(T model)
Set the model. The model is scoped to the conversations associated with the current request and action.

Parameters:
model -

getModelName

protected String getModelName()
The name of the model used to identify it in the ConversationContext. This can be overridden to provide the name of choice. The default is this.getClass().getName().

Returns:


Copyright © 2012-2013. All Rights Reserved.