Class MarshallingDirectives
- java.lang.Object
-
- akka.http.javadsl.server.directives.BasicDirectives
-
- akka.http.javadsl.server.directives.CacheConditionDirectives
-
- akka.http.javadsl.server.directives.CodingDirectives
-
- akka.http.javadsl.server.directives.CookieDirectives
-
- akka.http.javadsl.server.directives.DebuggingDirectives
-
- akka.http.javadsl.server.directives.ExecutionDirectives
-
- akka.http.javadsl.server.directives.FileAndResourceDirectives
-
- akka.http.javadsl.server.directives.FileUploadDirectives
-
- akka.http.javadsl.server.directives.FormFieldDirectives
-
- akka.http.javadsl.server.directives.FutureDirectives
-
- akka.http.javadsl.server.directives.HeaderDirectives
-
- akka.http.javadsl.server.directives.AttributeDirectives
-
- akka.http.javadsl.server.directives.HostDirectives
-
- akka.http.javadsl.server.directives.MarshallingDirectives
-
- Direct Known Subclasses:
MethodDirectives
public abstract class MarshallingDirectives extends HostDirectives
-
-
Constructor Summary
Constructors Constructor Description MarshallingDirectives()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Route
completeWith(Marshaller<T,? extends HttpResponse> marshaller, java.util.function.Consumer<java.util.function.Consumer<T>> inner)
Uses the marshaller for the given type to produce a completion function that is passed to its inner function.<T> Route
entity(Unmarshaller<? super HttpEntity,T> unmarshaller, java.util.function.Function<T,Route> inner)
Unmarshalls the requests entity using the given unmarshaller, and passes the result to [inner].<T,R>
RoutehandleWith(Unmarshaller<? super HttpEntity,T> unmarshaller, Marshaller<R,? extends HttpResponse> marshaller, java.util.function.Function<T,R> inner)
Completes the request using the given function.<T> Route
request(Unmarshaller<? super HttpRequest,T> unmarshaller, java.util.function.Function<T,Route> inner)
Unmarshalls the request using the given unmarshaller, and passes the result to [inner].-
Methods inherited from class akka.http.javadsl.server.directives.HostDirectives
extractHost, host, host, host, host
-
Methods inherited from class akka.http.javadsl.server.directives.AttributeDirectives
attribute, optionalAttribute
-
Methods inherited from class akka.http.javadsl.server.directives.HeaderDirectives
checkSameOrigin, headerValue, headerValueByName, headerValueByType, headerValuePF, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePF
-
Methods inherited from class akka.http.javadsl.server.directives.FutureDirectives
completeOrRecoverWith, onComplete, onComplete, onCompleteWithBreaker, onSuccess, onSuccess
-
Methods inherited from class akka.http.javadsl.server.directives.FormFieldDirectives
formField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptional
-
Methods inherited from class akka.http.javadsl.server.directives.FileUploadDirectives
fileUpload, fileUploadAll, storeUploadedFile, storeUploadedFiles
-
Methods inherited from class akka.http.javadsl.server.directives.FileAndResourceDirectives
defaultContentTypeResolver, defaultDirectoryRenderer, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResource, getFromResource, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, listDirectoryContents, listDirectoryContents, listDirectoryContents, listDirectoryContents
-
Methods inherited from class akka.http.javadsl.server.directives.ExecutionDirectives
handleExceptions, handleRejections
-
Methods inherited from class akka.http.javadsl.server.directives.DebuggingDirectives
logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResult
-
Methods inherited from class akka.http.javadsl.server.directives.CookieDirectives
cookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, optionalCookie, setCookie, setCookie
-
Methods inherited from class akka.http.javadsl.server.directives.CodingDirectives
decodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupport
-
Methods inherited from class akka.http.javadsl.server.directives.CacheConditionDirectives
conditional, conditional, conditional, conditional
-
Methods inherited from class akka.http.javadsl.server.directives.BasicDirectives
cancelRejection, cancelRejections, cancelRejections, extract, extractActorSystem, extractDataBytes, extractEntity, extractExecutionContext, extractLog, extractMatchedPath, extractMaterializer, extractParserSettings, extractRequest, extractRequestContext, extractRequestEntity, extractSettings, extractStrictEntity, extractStrictEntity, extractUnmatchedPath, extractUri, mapInnerRoute, mapRejections, mapRequest, mapRequestContext, mapResponse, mapResponseEntity, mapResponseHeaders, mapRouteResult, mapRouteResultFuture, mapRouteResultPF, mapRouteResultWith, mapRouteResultWithPF, mapSettings, mapUnmatchedPath, pass, provide, recoverRejections, recoverRejectionsWith, toStrictEntity, toStrictEntity, withExecutionContext, withLog, withMaterializer, withSettings
-
-
-
-
Method Detail
-
completeWith
public <T> Route completeWith(Marshaller<T,? extends HttpResponse> marshaller, java.util.function.Consumer<java.util.function.Consumer<T>> inner)
Uses the marshaller for the given type to produce a completion function that is passed to its inner function. You can use it do decouple marshaller resolution from request completion.- Parameters:
marshaller
- (undocumented)inner
- (undocumented)- Returns:
- (undocumented)
-
entity
public <T> Route entity(Unmarshaller<? super HttpEntity,T> unmarshaller, java.util.function.Function<T,Route> inner)
Unmarshalls the requests entity using the given unmarshaller, and passes the result to [inner]. If there is a problem with unmarshalling the request is rejected with theRejection
produced by the unmarshaller.- Parameters:
unmarshaller
- (undocumented)inner
- (undocumented)- Returns:
- (undocumented)
-
handleWith
public <T,R> Route handleWith(Unmarshaller<? super HttpEntity,T> unmarshaller, Marshaller<R,? extends HttpResponse> marshaller, java.util.function.Function<T,R> inner)
Completes the request using the given function. The input to the function is produced with the in-scope entity unmarshaller and the result value of the function is marshalled with the in-scope marshaller.- Parameters:
unmarshaller
- (undocumented)marshaller
- (undocumented)inner
- (undocumented)- Returns:
- (undocumented)
-
request
public <T> Route request(Unmarshaller<? super HttpRequest,T> unmarshaller, java.util.function.Function<T,Route> inner)
Unmarshalls the request using the given unmarshaller, and passes the result to [inner]. If there is a problem with unmarshalling the request is rejected with theRejection
produced by the unmarshaller.- Parameters:
unmarshaller
- (undocumented)inner
- (undocumented)- Returns:
- (undocumented)
-
-