Class AbstractFindIndexListActionSupport.FindIndexListResponse<M extends Serializable,T extends Serializable>

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

public static class AbstractFindIndexListActionSupport.FindIndexListResponse<M extends Serializable,T extends Serializable> extends Object
  • Constructor Details

    • FindIndexListResponse

      public FindIndexListResponse()
      Constructor for failure to create a finder Command.
    • FindIndexListResponse

      public FindIndexListResponse(ListSizeFinder<M> sizeFinderCommand, PageByIndexRangeFinder<M,T> pageFinderCommand)
      Constructor for successfully creating a finder Command.
      Parameters:
      sizeFinderCommand - Command object for retrieving list size, configured with any search parameters.
      pageFinderCommand - Command object for retrieving page, configured with any search parameters.
  • Method Details

    • makeFailureResponse

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

      public static <M extends Serializable, T extends Serializable> AbstractFindIndexListActionSupport.FindIndexListResponse<M,T> makeSuccessResponse(ListSizeFinder<M> sizeFinderCommand, PageByIndexRangeFinder<M,T> pageFinderCommand)
      Returns response for a successfully created finder Command and template class will retrieve list size.
    • makeSuccessWithListSizeResponse

      public static <M extends Serializable, T extends Serializable> AbstractFindIndexListActionSupport.FindIndexListResponse<M,T> makeSuccessWithListSizeResponse(ListSizeFinder<M> sizeFinderCommand, PageByIndexRangeFinder<M,T> pageFinderCommand, int listSize)
      Returns response for a successfully created finder Command and list size has already been retrieved.
    • getRejected

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

      public ListSizeFinder<M> getSizeFinderCommand()
      Returns Command object for reloading list size with the search parameters.
    • getPageFinderCommand

      public PageByIndexRangeFinder<M,T> getPageFinderCommand()
      Returns Command object for reloading list size 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)
    • getListSize

      public Integer getListSize()
      List size returned by sizeFinderCommand if it was already retrieved, or null if not.
    • setListSize

      public void setListSize(Integer listSize)
    • 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 size and page finders) 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.