T
- Type of API Request this RequestMapper will work onpublic abstract class ChainingRequestMapper<T extends ApiRequest> extends RequestMapper<T>
Constructor and Description |
---|
ChainingRequestMapper(ResourceDictionaries resourceDictionaries)
Constructor.
|
ChainingRequestMapper(ResourceDictionaries resourceDictionaries,
RequestMapper<T> next)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
T |
apply(T request,
javax.ws.rs.container.ContainerRequestContext context)
Rewrite and Validate the ApiRequest(e.g.
|
protected abstract T |
internalApply(T request,
javax.ws.rs.container.ContainerRequestContext context)
Rewrite and Validate the ApiRequest(e.g.
|
getResourceDictionaries
public ChainingRequestMapper(@NotNull ResourceDictionaries resourceDictionaries)
resourceDictionaries
- The dictionaries to use for request mapping.public ChainingRequestMapper(@NotNull ResourceDictionaries resourceDictionaries, @NotNull RequestMapper<T> next)
resourceDictionaries
- The dictionaries to use for request mapping.next
- The next request mapper to process this ApiRequestpublic final T apply(T request, javax.ws.rs.container.ContainerRequestContext context) throws RequestValidationException
This should throw an exception if the given/converted request is not valid.
apply
in class RequestMapper<T extends ApiRequest>
request
- the apiRequest to rewritecontext
- the ContainerRequestContext containing user and request informationRequestValidationException
- with the HTTP status and user-facing error msg to abort with
if the request is not validprotected abstract T internalApply(T request, javax.ws.rs.container.ContainerRequestContext context) throws RequestValidationException
This should throw an exception if the given/converted request is not valid.
request
- the apiRequest to rewritecontext
- the ContainerRequestContext containing user and request informationRequestValidationException
- with the HTTP status and user-facing error msg to abort with
if the request is not validCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.