类 RequestPredicates.SubPathServerRequestWrapper

java.lang.Object
cn.taketoday.web.handler.function.RequestPredicates.SubPathServerRequestWrapper
所有已实现的接口:
ServerRequest, ServerResponse.Context
封闭类:
RequestPredicates

private static class RequestPredicates.SubPathServerRequestWrapper extends Object implements ServerRequest
  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • requestPath

      private static RequestPath requestPath(RequestPath original, PathPattern.PathRemainingMatchInfo info)
    • mergeAttributes

      private static Map<String,Object> mergeAttributes(ServerRequest request, Map<String,String> pathVariables, PathPattern pattern)
    • method

      public HttpMethod method()
      从接口复制的说明: ServerRequest
      Get the HTTP method.
      指定者:
      method 在接口中 ServerRequest
      返回:
      the HTTP method as an HttpMethod enum value, or null if not resolvable (e.g. in case of a non-standard HTTP method)
    • methodName

      public String methodName()
      从接口复制的说明: ServerRequest
      Get the name of the HTTP method.
      指定者:
      methodName 在接口中 ServerRequest
      返回:
      the HTTP method as a String
    • uri

      public URI uri()
      从接口复制的说明: ServerRequest
      Get the request URI.
      指定者:
      uri 在接口中 ServerRequest
    • uriBuilder

      public UriBuilder uriBuilder()
      从接口复制的说明: ServerRequest
      Get a UriBuilderComponents from the URI associated with this ServerRequest.
      指定者:
      uriBuilder 在接口中 ServerRequest
      返回:
      a URI builder
    • requestPath

      public RequestPath requestPath()
      从接口复制的说明: ServerRequest
      Get the request path as a PathContainer.
      指定者:
      requestPath 在接口中 ServerRequest
    • headers

      public ServerRequest.Headers headers()
      从接口复制的说明: ServerRequest
      Get the headers of this request.
      指定者:
      headers 在接口中 ServerRequest
    • cookies

      public cn.taketoday.util.MultiValueMap<String,HttpCookie> cookies()
      从接口复制的说明: ServerRequest
      Get the cookies of this request.
      指定者:
      cookies 在接口中 ServerRequest
    • remoteAddress

      public Optional<InetSocketAddress> remoteAddress()
      从接口复制的说明: ServerRequest
      Get the remote address to which this request is connected, if available.
      指定者:
      remoteAddress 在接口中 ServerRequest
    • messageConverters

      public List<HttpMessageConverter<?>> messageConverters()
      从接口复制的说明: ServerRequest
      Get the readers used to convert the body of this request.
      指定者:
      messageConverters 在接口中 ServerRequest
      指定者:
      messageConverters 在接口中 ServerResponse.Context
      返回:
      the list of message writers
    • body

      public <T> T body(Class<T> bodyType) throws IOException
      从接口复制的说明: ServerRequest
      Extract the body as an object of the given type.
      指定者:
      body 在接口中 ServerRequest
      类型参数:
      T - the body type
      参数:
      bodyType - the type of return value
      返回:
      the body
      抛出:
      IOException
    • body

      public <T> T body(cn.taketoday.core.ParameterizedTypeReference<T> bodyType) throws IOException
      从接口复制的说明: ServerRequest
      Extract the body as an object of the given type.
      指定者:
      body 在接口中 ServerRequest
      类型参数:
      T - the body type
      参数:
      bodyType - the type of return value
      返回:
      the body
      抛出:
      IOException
    • bind

      public <T> T bind(Class<T> bindType) throws cn.taketoday.validation.BindException
      从接口复制的说明: ServerRequest
      Bind to this request and return an instance of the given type.
      指定者:
      bind 在接口中 ServerRequest
      类型参数:
      T - the type to bind to
      参数:
      bindType - the type of class to bind this request to
      返回:
      a constructed and bound instance of bindType
      抛出:
      cn.taketoday.validation.BindException - in case of binding errors
    • bind

      public <T> T bind(Class<T> bindType, Consumer<WebDataBinder> dataBinderCustomizer) throws cn.taketoday.validation.BindException
      从接口复制的说明: ServerRequest
      Bind to this request and return an instance of the given type.
      指定者:
      bind 在接口中 ServerRequest
      类型参数:
      T - the type to bind to
      参数:
      bindType - the type of class to bind this request to
      dataBinderCustomizer - used to customize the data binder, e.g. set (dis)allowed fields
      返回:
      a constructed and bound instance of bindType
      抛出:
      cn.taketoday.validation.BindException - in case of binding errors
    • attribute

      public Optional<Object> attribute(String name)
      从接口复制的说明: ServerRequest
      Get the request attribute value if present.
      指定者:
      attribute 在接口中 ServerRequest
      参数:
      name - the attribute name
      返回:
      the attribute value
    • attributes

      public Map<String,Object> attributes()
      从接口复制的说明: ServerRequest
      Get a mutable map of request attributes.
      指定者:
      attributes 在接口中 ServerRequest
      返回:
      the request attributes
    • param

      public Optional<String> param(String name)
      从接口复制的说明: ServerRequest
      Get the first parameter with the given name, if present. parameters are contained in the query string or posted form data.
      指定者:
      param 在接口中 ServerRequest
      参数:
      name - the parameter name
      返回:
      the parameter value
      另请参阅:
    • params

      public List<String> params(String name)
      从接口复制的说明: ServerRequest
      Get the parameters with the given name.

      parameters are contained in the query string or posted form data.

      指定者:
      params 在接口中 ServerRequest
      参数:
      name - the parameter name
      返回:
      the parameter value
      另请参阅:
    • params

      public cn.taketoday.util.MultiValueMap<String,String> params()
      从接口复制的说明: ServerRequest
      Get all parameters for this request. parameters are contained in the query string or posted form data.
      指定者:
      params 在接口中 ServerRequest
      另请参阅:
    • multipartData

      public cn.taketoday.util.MultiValueMap<String,Multipart> multipartData() throws IOException
      从接口复制的说明: ServerRequest
      Get the parts of a multipart request, provided the Content-Type is "multipart/form-data", or an exception otherwise.
      指定者:
      multipartData 在接口中 ServerRequest
      返回:
      the multipart data, mapping from name to part(s)
      抛出:
      IOException - if an I/O error occurred during the retrieval
      另请参阅:
    • pathVariables

      public Map<String,String> pathVariables()
      从接口复制的说明: ServerRequest
      Get all path variables for this request.
      指定者:
      pathVariables 在接口中 ServerRequest
    • exchange

      public RequestContext exchange()
      从接口复制的说明: ServerRequest
      Get the request that this request is based on.
      指定者:
      exchange 在接口中 ServerRequest
    • checkNotModified

      public Optional<ServerResponse> checkNotModified(Instant lastModified)
      从接口复制的说明: ServerRequest
      Check whether the requested resource has been modified given the supplied last-modified timestamp (as determined by the application). If not modified, this method returns a response with corresponding status code and headers, otherwise an empty result.

      Typical usage:

      
       public ServerResponse myHandleMethod(ServerRequest request) {
         Instant lastModified = // application-specific calculation
       	 return request.checkNotModified(lastModified)
       	   .orElseGet(() -> {
       	     // further request processing, actually building content
       		 return ServerResponse.ok().body(...);
           });
       }
       

      This method works with conditional GET/HEAD requests, but also with conditional POST/PUT/DELETE requests.

      Note: you can use either this #checkNotModified(Instant) method; or ServerRequest.checkNotModified(String). If you want to enforce both a strong entity tag and a Last-Modified value, as recommended by the HTTP specification, then you should use ServerRequest.checkNotModified(Instant, String).

      指定者:
      checkNotModified 在接口中 ServerRequest
      参数:
      lastModified - the last-modified timestamp that the application determined for the underlying resource
      返回:
      a corresponding response if the request qualifies as not modified, or an empty result otherwise.
    • checkNotModified

      public Optional<ServerResponse> checkNotModified(String etag)
      从接口复制的说明: ServerRequest
      Check whether the requested resource has been modified given the supplied ETag (entity tag), as determined by the application. If not modified, this method returns a response with corresponding status code and headers, otherwise an empty result.

      Typical usage:

      
       public ServerResponse myHandleMethod(ServerRequest request) {
         String eTag = // application-specific calculation
       	 return request.checkNotModified(eTag)
       	   .orElseGet(() -> {
       	     // further request processing, actually building content
       		 return ServerResponse.ok().body(...);
           });
       }

      This method works with conditional GET/HEAD requests, but also with conditional POST/PUT/DELETE requests.

      Note: you can use either this ServerRequest.checkNotModified(Instant) method; or #checkNotModified(String). If you want to enforce both a strong entity tag and a Last-Modified value, as recommended by the HTTP specification, then you should use ServerRequest.checkNotModified(Instant, String).

      指定者:
      checkNotModified 在接口中 ServerRequest
      参数:
      etag - the entity tag that the application determined for the underlying resource. This parameter will be padded with quotes (") if necessary.
      返回:
      a corresponding response if the request qualifies as not modified, or an empty result otherwise.
    • checkNotModified

      public Optional<ServerResponse> checkNotModified(Instant lastModified, String etag)
      从接口复制的说明: ServerRequest
      Check whether the requested resource has been modified given the supplied ETag (entity tag) and last-modified timestamp, as determined by the application. If not modified, this method returns a response with corresponding status code and headers, otherwise an empty result.

      Typical usage:

      
       public ServerResponse myHandleMethod(ServerRequest request) {
         Instant lastModified = // application-specific calculation
         String eTag = // application-specific calculation
       	 return request.checkNotModified(lastModified, eTag)
       	   .orElseGet(() -> {
       	     // further request processing, actually building content
       		 return ServerResponse.ok().body(...);
           });
       }

      This method works with conditional GET/HEAD requests, but also with conditional POST/PUT/DELETE requests.

      指定者:
      checkNotModified 在接口中 ServerRequest
      参数:
      lastModified - the last-modified timestamp that the application determined for the underlying resource
      etag - the entity tag that the application determined for the underlying resource. This parameter will be padded with quotes (") if necessary.
      返回:
      a corresponding response if the request qualifies as not modified, or an empty result otherwise.
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object