org.qi4j.library.struts2.support.list
Class ProvidesListOfMixin<T>

java.lang.Object
  extended by com.opensymphony.xwork2.ActionSupport
      extended by org.qi4j.library.struts2.support.list.ProvidesListOfMixin<T>
All Implemented Interfaces:
com.opensymphony.xwork2.Action, com.opensymphony.xwork2.LocaleProvider, com.opensymphony.xwork2.Preparable, com.opensymphony.xwork2.TextProvider, com.opensymphony.xwork2.Validateable, com.opensymphony.xwork2.ValidationAware, Serializable, ProvidesListOf<T>, StrutsAction

public abstract class ProvidesListOfMixin<T>
extends com.opensymphony.xwork2.ActionSupport
implements ProvidesListOf<T>

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
ProvidesListOfMixin()
           
 
Method Summary
 Iterable<T> list()
           
 void prepare()
          This is where we'll load the list of entities.
 
Methods inherited from class com.opensymphony.xwork2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, doDefault, execute, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getLocale, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, pause, setActionErrors, setActionMessages, setFieldErrors, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.opensymphony.xwork2.Action
execute
 
Methods inherited from interface com.opensymphony.xwork2.Validateable
validate
 
Methods inherited from interface com.opensymphony.xwork2.ValidationAware
addActionError, addActionMessage, addFieldError, getActionErrors, getActionMessages, getFieldErrors, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors
 
Methods inherited from interface com.opensymphony.xwork2.TextProvider
getText, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasKey
 
Methods inherited from interface com.opensymphony.xwork2.LocaleProvider
getLocale
 

Constructor Detail

ProvidesListOfMixin

public ProvidesListOfMixin()
Method Detail

list

public Iterable<T> list()
Specified by:
list in interface ProvidesListOf<T>

prepare

public void prepare()
             throws Exception
This is where we'll load the list of entities. Not because it is any better than the execute() method, I would actually prefer doing it in the execute method. But since these list actions can be the target of redirects after errors, actionErrors may not be empty which would mean execute() would never get called. One way around this would be to have a different interceptor stack just for these list actions that doesn't do validation, but for now we'll just use the prepare() method. We can change it easily enough later if this becomes an issue for some reason.

Specified by:
prepare in interface com.opensymphony.xwork2.Preparable
Throws:
Exception