Class AbstractFindIdListActionSupport.FindIdListResponse<M extends Serializable,K extends Serializable>
java.lang.Object
name.matthewgreet.strutscommons.action.AbstractFindIdListActionSupport.FindIdListResponse<M,K>
- Enclosing class:
AbstractFindIdListActionSupport<M extends Serializable,
K extends Serializable, F extends AbstractForm>
public static class AbstractFindIdListActionSupport.FindIdListResponse<M extends Serializable,K extends Serializable>
extends Object
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for failure to create a finder Command.FindIdListResponse
(IdListFinder<M, K> finderCommand) Constructor for successfully creating a finder Command. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addErrorMessage
(String text) Convenience function to add error message.void
addInfoMessage
(String text) Convenience function to add info message.Struts errors messages to be used, usually for update failure.Action result name to use if response reports failure.Returns Command object for reloading list with the search parameters.getIds()
List size returned by sizeFinderCommand if it was already retrieved, or null if not.Struts information messages to be used, usually for update success.boolean
Indicates creating the finder Command failed or, if it was retrieved, the id list was rejected.Action result name to use if response reports success.static <M extends Serializable,
K extends Serializable>
AbstractFindIdListActionSupport.FindIdListResponse<M, K> makeFailureResponse
(String message) Returns response for a failure to create a finder Command or list was rejected.static <M extends Serializable,
K extends Serializable>
AbstractFindIdListActionSupport.FindIdListResponse<M, K> makeSuccessResponse
(IdListFinder<M, K> finderCommand) Returns response for a successfully created finder Command and template class will retrieve list.static <M extends Serializable,
K extends Serializable>
AbstractFindIdListActionSupport.FindIdListResponse<M, K> makeSuccessWithIdsResponse
(IdListFinder<M, K> finderCommand, List<K> ids) Returns response for a successfully created finder Command and list has already been retrieved.void
setFailureResultName
(String value) void
void
setSuccessResultName
(String value)
-
Constructor Details
-
FindIdListResponse
public FindIdListResponse()Constructor for failure to create a finder Command. -
FindIdListResponse
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,K extends Serializable> AbstractFindIdListActionSupport.FindIdListResponse<M,K> makeFailureResponse(String message) Returns response for a failure to create a finder Command or list was rejected. -
makeSuccessResponse
public static <M extends Serializable,K extends Serializable> AbstractFindIdListActionSupport.FindIdListResponse<M,K> makeSuccessResponse(IdListFinder<M, K> finderCommand) Returns response for a successfully created finder Command and template class will retrieve list. -
makeSuccessWithIdsResponse
public static <M extends Serializable,K extends Serializable> AbstractFindIdListActionSupport.FindIdListResponse<M,K> makeSuccessWithIdsResponse(IdListFinder<M, K> finderCommand, List<K> ids) 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 id list was rejected. If set, template base class uses action result named bygetFailureResultName()
, otherwise uses action result named bygetSuccessResultName()
. Defaults to true. -
getFinderCommand
Returns Command object for reloading list with the search parameters. -
getFailureResultName
Action result name to use if response reports failure. Defaults to "input". -
setFailureResultName
-
getSuccessResultName
Action result name to use if response reports success. Defaults to "success". -
setSuccessResultName
-
getIds
List size returned by sizeFinderCommand if it was already retrieved, or null if not. -
setIds
-
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
Struts information messages to be used, usually for update success. An info message does not indicate a success (use constructor accepting id finder) and is displayed even for failure (though that's unusual). -
addErrorMessage
Convenience function to add error message. -
addInfoMessage
Convenience function to add info message.
-