接口的使用
cn.taketoday.web.handler.function.ServerResponse
使用ServerResponse的程序包
程序包
说明
Provides the types that make up Infra functional web framework.
Classes supporting the
cn.taketoday.web.servlet.function package.-
cn.taketoday.web.handler.function中ServerResponse的使用
修饰符和类型类说明private static classinterfaceHandlerFilterFunction<T extends ServerResponse,R extends ServerResponse> Represents a function that filters a handler function.interfaceHandlerFilterFunction<T extends ServerResponse,R extends ServerResponse> Represents a function that filters a handler function.interfaceHandlerFunction<T extends ServerResponse>Represents a function that handles a request.interfaceRouterFunction<T extends ServerResponse>Represents a function that routes to a handler function.(专用程序包) static class(专用程序包) static final classprivate static final classprivate static final class(专用程序包) static final classRouterFunctions.FilteredRouterFunction<T extends ServerResponse,S extends ServerResponse> Filter the specified handler functions with the given filter function.(专用程序包) static final classRouterFunctions.FilteredRouterFunction<T extends ServerResponse,S extends ServerResponse> Filter the specified handler functions with the given filter function.(专用程序包) static final classA composed routing function that first invokes one function, and then invokes the another function (of the same response typeT) if this route had no result.修饰符和类型接口说明interfaceAsynchronous subtype ofServerResponsethat exposes the future response.interfaceEntity-specific subtype ofServerResponsethat exposes entity data.interfaceRendering-specific subtype ofServerResponsethat exposes model and template data.修饰符和类型类说明(专用程序包) classAbstract base class forServerResponseimplementations.(专用程序包) final classDefaultAsyncServerResponseimplementation.private static classEntityResponseimplementation for asynchronousCompletionStagebodies.private static classDefaultEntityResponseimplementation for synchronous bodies.private static classEntityResponseimplementation for asynchronousPublisherbodies.private static final classprivate static class(专用程序包) classBase class forServerResponseimplementations with error handling.(专用程序包) static class(专用程序包) final classImplementation ofServerResponsefor sending Server-Sent Events.类型参数类型为ServerResponse的cn.taketoday.web.handler.function中的字段修饰符和类型字段说明private final ArrayList<HandlerFilterFunction<ServerResponse,ServerResponse>> RouterFunctionBuilder.errorHandlersprivate final ArrayList<HandlerFilterFunction<ServerResponse,ServerResponse>> RouterFunctionBuilder.errorHandlersprivate final ArrayList<HandlerFilterFunction<ServerResponse,ServerResponse>> RouterFunctionBuilder.filterFunctionsprivate final ArrayList<HandlerFilterFunction<ServerResponse,ServerResponse>> RouterFunctionBuilder.filterFunctionsprivate final CompletableFuture<ServerResponse>DefaultAsyncServerResponse.futureResponseprivate final List<RouterFunction<ServerResponse>>RouterFunctionBuilder.BuiltRouterFunction.routerFunctionsprivate final ArrayList<RouterFunction<ServerResponse>>RouterFunctionBuilder.routerFunctions类型参数类型为ServerResponse的cn.taketoday.web.handler.function中的方法修饰符和类型方法说明protected final <T extends ServerResponse>
voidErrorHandlingServerResponse.addErrorHandler(Predicate<Throwable> predicate, BiFunction<Throwable, ServerRequest, T> errorHandler) static <T extends ServerResponse>
RouterFunction<T>RouterFunctions.changeParser(RouterFunction<T> routerFunction, PathPatternParser parser) Changes thePathPatternParseron the given router function.default <S extends ServerResponse>
RouterFunction<S>RouterFunction.filter(HandlerFilterFunction<T, S> filterFunction) Filter all handler functions routed by this function with the given filter function.static <T extends ServerResponse>
RouterFunction<T>RouterFunctions.nest(RequestPredicate predicate, RouterFunction<T> routerFunction) Route to the given router function if the given request predicate applies.static <T extends ServerResponse>
HandlerFilterFunction<T,T> HandlerFilterFunction.ofErrorHandler(Predicate<Throwable> predicate, BiFunction<Throwable, ServerRequest, T> errorHandler) Adapt the given predicate and response provider function to a filter function that returns aServerResponseon a given exception.static <T extends ServerResponse>
HandlerFilterFunction<T,T> HandlerFilterFunction.ofRequestProcessor(Function<ServerRequest, ServerRequest> requestProcessor) Adapt the given request processor function to a filter function that only operates on theServerRequest.static <T extends ServerResponse,R extends ServerResponse>
HandlerFilterFunction<T,R> HandlerFilterFunction.ofResponseProcessor(BiFunction<ServerRequest, T, R> responseProcessor) Adapt the given response processor function to a filter function that only operates on theServerResponse.static <T extends ServerResponse,R extends ServerResponse>
HandlerFilterFunction<T,R> HandlerFilterFunction.ofResponseProcessor(BiFunction<ServerRequest, T, R> responseProcessor) Adapt the given response processor function to a filter function that only operates on theServerResponse.static <T extends ServerResponse>
RouterFunction<T>RouterFunctions.route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) Route to the given handler function if the given request predicate applies.修饰符和类型方法说明static ServerResponseCreate a (built) response with the given asynchronous response.static ServerResponseCreate a (built) response with the given asynchronous response.AsyncServerResponse.block()Blocks indefinitely until the future response is obtained.DefaultAsyncServerResponse.block()<T> ServerResponseDefaultServerResponseBuilder.body(T body, cn.taketoday.core.ParameterizedTypeReference<T> bodyType) Set the body of the response to the givenObjectand return it.<T> ServerResponseServerResponse.BodyBuilder.body(T body, cn.taketoday.core.ParameterizedTypeReference<T> bodyType) Set the body of the response to the givenObjectand return it.DefaultServerResponseBuilder.build()DefaultServerResponseBuilder.build(ServerResponse.HeadersBuilder.WriteFunction writeFunction) ServerResponse.HeadersBuilder.build()Build the response entity with no body.ServerResponse.HeadersBuilder.build(ServerResponse.HeadersBuilder.WriteFunction writeFunction) Build the response entity with a custom write function.protected final ServerResponseErrorHandlingServerResponse.errorResponse(Throwable t, RequestContext request) static ServerResponseServerResponse.from(ErrorResponse response) Create aServerResponsefrom the givenErrorResponse.ResourceHandlerFunction.handle(ServerRequest request) DefaultServerResponseBuilder.render(ModelAndView modelAndView) ServerResponse.BodyBuilder.render(ModelAndView modelAndView) Render the template with the givenModelAndView.Render the template with the givennameusing the givenmodelAttributes.Render the template with the givennameusing the givenmodel.static ServerResponseServerResponse.sse(Consumer<ServerResponse.SseBuilder> consumer) Create a server-sent event response.static ServerResponseServerResponse.sse(Consumer<ServerResponse.SseBuilder> consumer, Duration timeout) Create a server-sent event response.返回变量类型为ServerResponse的类型的cn.taketoday.web.handler.function中的方法修饰符和类型方法说明RouterFunctionBuilder.build()RouterFunctions.Builder.build()Builds theRouterFunction.(专用程序包) static Optional<ServerResponse>DefaultServerRequest.checkNotModified(RequestContext context, Instant lastModified, String etag) RequestPredicates.SubPathServerRequestWrapper.checkNotModified(String etag) RequestPredicates.SubPathServerRequestWrapper.checkNotModified(Instant lastModified) RequestPredicates.SubPathServerRequestWrapper.checkNotModified(Instant lastModified, String etag) default Optional<ServerResponse>ServerRequest.checkNotModified(String etag) Check whether the requested resource has been modified given the suppliedETag(entity tag), as determined by the application.default Optional<ServerResponse>ServerRequest.checkNotModified(Instant lastModified) Check whether the requested resource has been modified given the supplied last-modified timestamp (as determined by the application).default Optional<ServerResponse>ServerRequest.checkNotModified(Instant lastModified, String etag) Check whether the requested resource has been modified given the suppliedETag(entity tag) and last-modified timestamp, as determined by the application.private DeferredResult<ServerResponse>DefaultAsyncServerResponse.createDeferredResult(RequestContext request) private DeferredResult<ServerResponse>DefaultEntityResponseBuilder.CompletionStageEntityResponse.createDeferredResult(RequestContext request, ServerResponse.Context context) static RouterFunction<ServerResponse>Route requests that match the given pattern to resources relative to the given root location.static RouterFunction<ServerResponse>RouterFunctions.resources(Function<ServerRequest, Optional<cn.taketoday.core.io.Resource>> lookupFunction) Route to resources using the provided lookup function.RouterFunctionBuilder.BuiltRouterFunction.route(ServerRequest request) RouterFunctions.DifferentComposedRouterFunction.route(ServerRequest request) RouterFunctions.ResourcesRouterFunction.route(ServerRequest request) 修饰符和类型方法说明static ServerResponse.BodyBuilderServerResponse.from(ServerResponse other) Create a builder with the status code and headers of the given response.类型变量类型为ServerResponse的cn.taketoday.web.handler.function中的方法参数修饰符和类型方法说明private RouterFunctions.BuilderRouterFunctionBuilder.add(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.add(RouterFunction<ServerResponse> routerFunction) RouterFunctions.Builder.add(RouterFunction<ServerResponse> routerFunction) Adds the given route to this builder.RouterFunctionBuilder.after(BiFunction<ServerRequest, ServerResponse, ServerResponse> responseProcessor) RouterFunctionBuilder.after(BiFunction<ServerRequest, ServerResponse, ServerResponse> responseProcessor) RouterFunctions.Builder.after(BiFunction<ServerRequest, ServerResponse, ServerResponse> responseProcessor) Filter the response object for all routes created by this builder with the given response processing function.RouterFunctions.Builder.after(BiFunction<ServerRequest, ServerResponse, ServerResponse> responseProcessor) Filter the response object for all routes created by this builder with the given response processing function.private <R> RDefaultAsyncServerResponse.delegate(Function<ServerResponse, R> function) RouterFunctionBuilder.DELETE(HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.DELETE(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.DELETE(String pattern, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.DELETE(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctions.Builder.DELETE(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPDELETErequests.RouterFunctions.Builder.DELETE(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPDELETErequests that match the given predicate.RouterFunctions.Builder.DELETE(String pattern, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPDELETErequests that match the given pattern.RouterFunctions.Builder.DELETE(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPDELETErequests that match the given pattern and predicate.RouterFunctionBuilder.filter(HandlerFilterFunction<ServerResponse, ServerResponse> filterFunction) RouterFunctionBuilder.filter(HandlerFilterFunction<ServerResponse, ServerResponse> filterFunction) RouterFunctions.Builder.filter(HandlerFilterFunction<ServerResponse, ServerResponse> filterFunction) Filters all routes created by this builder with the given filter function.RouterFunctions.Builder.filter(HandlerFilterFunction<ServerResponse, ServerResponse> filterFunction) Filters all routes created by this builder with the given filter function.RouterFunctionBuilder.GET(HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.GET(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.GET(String pattern, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.GET(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctions.Builder.GET(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPGETrequests.RouterFunctions.Builder.GET(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPGETrequests that match the given predicate.RouterFunctions.Builder.GET(String pattern, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPGETrequests that match the given pattern.RouterFunctions.Builder.GET(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPGETrequests that match the given pattern and predicate.RouterFunctionBuilder.HEAD(HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.HEAD(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.HEAD(String pattern, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.HEAD(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctions.Builder.HEAD(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPHEADrequests.RouterFunctions.Builder.HEAD(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPHEADrequests that match the given predicate.RouterFunctions.Builder.HEAD(String pattern, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPHEADrequests that match the given pattern.RouterFunctions.Builder.HEAD(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPHEADrequests that match the given pattern and predicate.RouterFunctionBuilder.nest(RequestPredicate predicate, Supplier<RouterFunction<ServerResponse>> routerFunctionSupplier) RouterFunctions.Builder.nest(RequestPredicate predicate, Supplier<RouterFunction<ServerResponse>> routerFunctionSupplier) Route to the supplied router function if the given request predicate applies.RouterFunctionBuilder.onError(Class<? extends Throwable> exceptionType, BiFunction<Throwable, ServerRequest, ServerResponse> responseProvider) RouterFunctionBuilder.onError(Predicate<Throwable> predicate, BiFunction<Throwable, ServerRequest, ServerResponse> responseProvider) RouterFunctions.Builder.onError(Class<? extends Throwable> exceptionType, BiFunction<Throwable, ServerRequest, ServerResponse> responseProvider) Filters all exceptions of the given type by applying the given response provider function.RouterFunctions.Builder.onError(Predicate<Throwable> predicate, BiFunction<Throwable, ServerRequest, ServerResponse> responseProvider) Filters all exceptions that match the predicate by applying the given response provider function.RouterFunctionBuilder.OPTIONS(HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.OPTIONS(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.OPTIONS(String pattern, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.OPTIONS(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctions.Builder.OPTIONS(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPOPTIONSrequests.RouterFunctions.Builder.OPTIONS(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPOPTIONSrequests that match the given predicate.RouterFunctions.Builder.OPTIONS(String pattern, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPOPTIONSrequests that match the given pattern.RouterFunctions.Builder.OPTIONS(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPOPTIONSrequests that match the given pattern and predicate.RouterFunctionBuilder.PATCH(HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.PATCH(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.PATCH(String pattern, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.PATCH(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctions.Builder.PATCH(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPPATCHrequests.RouterFunctions.Builder.PATCH(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPPATCHrequests that match the given predicate.RouterFunctions.Builder.PATCH(String pattern, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPPATCHrequests that match the given pattern.RouterFunctions.Builder.PATCH(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPPATCHrequests that match the given pattern and predicate.RouterFunctionBuilder.path(String pattern, Supplier<RouterFunction<ServerResponse>> routerFunctionSupplier) RouterFunctions.Builder.path(String pattern, Supplier<RouterFunction<ServerResponse>> routerFunctionSupplier) Route to the supplied router function if the given path prefix pattern applies.RouterFunctionBuilder.POST(HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.POST(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.POST(String pattern, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.POST(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctions.Builder.POST(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPPOSTrequests.RouterFunctions.Builder.POST(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPPOSTrequests that match the given predicate.RouterFunctions.Builder.POST(String pattern, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPPOSTrequests that match the given pattern.RouterFunctions.Builder.POST(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPPOSTrequests that match the given pattern and predicate.RouterFunctionBuilder.PUT(HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.PUT(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.PUT(String pattern, HandlerFunction<ServerResponse> handlerFunction) RouterFunctionBuilder.PUT(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctions.Builder.PUT(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPPUTrequests.RouterFunctions.Builder.PUT(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPPUTrequests that match the given predicate.RouterFunctions.Builder.PUT(String pattern, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPPUTrequests that match the given pattern.RouterFunctions.Builder.PUT(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPPUTrequests that match the given pattern and predicate.RouterFunctionBuilder.route(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) RouterFunctions.Builder.route(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all requests that match the given predicate.类型变量类型为ServerResponse的cn.taketoday.web.handler.function中的构造器参数限定符构造器说明BuiltRouterFunction(List<RouterFunction<ServerResponse>> routerFunctions) privateDefaultAsyncServerResponse(CompletableFuture<ServerResponse> futureResponse, Duration timeout) -
cn.taketoday.web.handler.function.support中ServerResponse的使用
修饰符和类型方法说明private ServerResponseHandlerFunctionAdapter.handleAsync(WebAsyncManager asyncManager)