public abstract class AbstractPaginationStrategy extends Object implements PaginationStrategy
PaginationInfo as a parameter.
Subclasses can implement setResponseHeaders(PaginationMetadata, HttpServletResponse, int) to set the HTTP Response
headers.| Constructor and Description |
|---|
AbstractPaginationStrategy() |
| Modifier and Type | Method and Description |
|---|---|
private int |
argAsInt(Map<String,Object> args,
String argName) |
private PaginationMetadata |
createMetadata(RouteContext routeContext,
PaginationInfo pagingInfo) |
PaginationInfo |
createPaginationInfo(RouteContext routeContext,
Map<String,Object> args)
Creates a PaginationInfo instance.
|
private String |
getResourcePath(RouteContext routeContext) |
private List<Object> |
merge(PaginationInfo paginationInfo,
Map<String,Object> arguments) |
Object |
postInvocation(Collection<?> results,
RouteContext routeContext,
PaginationInfo pagingInfo)
Called after the target endpoint method has been invoked and allows the strategy to set HTTP Response headers.
|
Object[] |
preInvocation(PaginationInfo paginationInfo,
Map<String,Object> arguments)
Called before the target endpoint method has been invoked and enables a concrete strategy to manipulate the arguments
that will be passed to the target endpoint method.
|
abstract void |
setResponseHeaders(PaginationMetadata metadata,
javax.servlet.http.HttpServletResponse response,
int resultSize) |
public abstract void setResponseHeaders(PaginationMetadata metadata, javax.servlet.http.HttpServletResponse response, int resultSize)
public PaginationInfo createPaginationInfo(RouteContext routeContext, Map<String,Object> args)
PaginationStrategycreatePaginationInfo in interface PaginationStrategyrouteContext - the RouteContext of the route being processed.args - the extracted arguments from the current request.PaginationInfo the information required for paging.public Object[] preInvocation(PaginationInfo paginationInfo, Map<String,Object> arguments)
PaginationStrategypreInvocation in interface PaginationStrategypaginationInfo - the PaginationInfo instance created by this strategy.arguments - the extracted arguments from the current request.Object[] the arguments that will be passed to the target endpoint method.public Object postInvocation(Collection<?> results, RouteContext routeContext, PaginationInfo pagingInfo)
PaginationStrategypostInvocation in interface PaginationStrategyresults - the result returned from the target endpoint method.routeContext - the RouteContext.pagingInfo - the PaginationInfo instance created by this strategy.Object Either the unchanged result or a modified result depending on the underlying implementation.private PaginationMetadata createMetadata(RouteContext routeContext, PaginationInfo pagingInfo)
private String getResourcePath(RouteContext routeContext)
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.