Class AbstractFindListActionSupport.FindListResponse<M extends Serializable,T extends Serializable>

java.lang.Object
name.matthewgreet.strutscommons.action.AbstractFindListActionSupport.FindListResponse<M,T>
Enclosing class:
AbstractFindListActionSupport<M extends Serializable,T extends Serializable,F extends AbstractForm>

public static class AbstractFindListActionSupport.FindListResponse<M extends Serializable,T extends Serializable> extends Object
  • Constructor Details

    • FindListResponse

      public FindListResponse()
      Constructor for failure to create a finder Command or list rejected.
    • FindListResponse

      public FindListResponse(ListFinder<M,T> finderCommand)
      Constructor for successfully creating a finder Command.
      Parameters:
      finderCommand - Command object for retrieving list, configured with any search parameters.
  • Method Details

    • makeFailureResponse

      public static <M extends Serializable, T extends Serializable> AbstractFindListActionSupport.FindListResponse<M,T> makeFailureResponse(String message)
      Returns response for a failure to create a finder Command or list was rejected.
    • makeSuccessResponse

      public static <M extends Serializable, T extends Serializable> AbstractFindListActionSupport.FindListResponse<M,T> makeSuccessResponse(ListFinder<M,T> finderCommand)
      Returns response for a successfully created finder Command and template class will retrieve list.
    • makeSuccessWithListResponse

      public static <M extends Serializable, T extends Serializable> AbstractFindListActionSupport.FindListResponse<M,T> makeSuccessWithListResponse(ListFinder<M,T> finderCommand, List<T> list)
      Returns response for a successfully created finder Command and list has already been retrieved.
    • getRejected

      public boolean getRejected()
      Indicates creating the finder Command failed or, if it was retrieved, the list was rejected. If set, template base class uses action result named by getFailureResultName(), otherwise uses action result named by getSuccessResultName(). Defaults to true.
    • getFinderCommand

      public ListFinder<M,T> getFinderCommand()
      Returns Command object for reloading list with the search parameters.
    • getFailureResultName

      public String getFailureResultName()
      Action result name to use if response reports failure. Defaults to "input".
    • setFailureResultName

      public void setFailureResultName(String value)
    • getSuccessResultName

      public String getSuccessResultName()
      Action result name to use if response reports success. Defaults to "success".
    • setSuccessResultName

      public void setSuccessResultName(String value)
    • getList

      public List<T> getList()
      List returned by finderCommand if it was already retrieved, or null if not.
    • setList

      public void setList(List<T> list)
    • getErrors

      public Collection<String> getErrors()
      Struts errors messages to be used, usually for update failure. An error message does not indicate an error (use default constructor) and is displayed even for success (though that's unusual).
    • getMessages

      public Collection<String> getMessages()
      Struts information messages to be used, usually for update success. An info message does not indicate a success (use constructor accepting list finder) and is displayed even for failure (though that's unusual).
    • addErrorMessage

      public void addErrorMessage(String text)
      Convenience function to add error message.
    • addInfoMessage

      public void addInfoMessage(String text)
      Convenience function to add info message.