Class WebEndpointMapping<E>

java.lang.Object
io.microsphere.spring.web.metadata.WebEndpointMapping<E>
Type Parameters:
E - the type of endpoint

public class WebEndpointMapping<E> extends Object
The meta-data class for Web Endpoint Mapping that could be one of these endpoints:
  • Servlet
  • Servlet's Filter
  • Spring WebMVC DispatcherServlet
  • Spring WebFlux DispatcherHandler
  • Customized

The method getKind() can be used to identify the kind of endpoints, and the method getEndpoint() is an abstract presentation of actual endpoint that may be :

  • the name of Servlet
  • the name of Servlet's Filter
  • the any handler of Spring WebMVC org.springframework.web.servlet.HandlerMapping:
    • The String presenting the name of Handler bean
    • The org.springframework.web.servlet.mvc.Controller Bean
    • The HandlerMethod could be annotated the @RequestMapping
    • The org.springframework.web.servlet.function.HandlerFunction since Spring Framework 5.2
  • the any handler of Spring WebFlux org.springframework.web.reactive.HandlerMapping:
    • The String presenting the name of Handler bean
    • The HandlerMethod could be annotated the @RequestMapping
    • The org.springframework.web.reactive.function.server.RouterFunction since Spring Framework 5.0

The method getSource() can trace the source of WebEndpointMapping if present, it could be :

  • ServletContext
  • Spring WebMVC org.springframework.web.servlet.HandlerMapping
  • Spring WebFlux org.springframework.web.reactive.HandlerMapping
, or it's non-source
Since:
1.0.0
Author:
Mercy
See Also:
  • ServletRegistration
  • FilterRegistration
  • WebServlet
  • WebFilter
  • org.springframework.web.servlet.DispatcherServlet
  • org.springframework.web.reactive.DispatcherHandler
  • org.springframework.web.servlet.HandlerMapping
  • org.springframework.web.reactive.HandlerMapping
  • RequestMapping
  • org.springframework.web.servlet.mvc.method.RequestMappingInfo
  • org.springframework.web.reactive.result.method.RequestMappingInfo
  • Field Details

    • ID_HEADER_NAME

      public static final String ID_HEADER_NAME
      The HTTP header name for getId()
      See Also:
    • NON_ENDPOINT

      public static final Object NON_ENDPOINT
    • NON_SOURCE

      public static final Object NON_SOURCE
  • Method Details

    • of

      public static WebEndpointMapping.Builder<?> of(Collection<String> patterns)
    • of

      public static WebEndpointMapping.Builder<?> of(String... patterns)
    • of

      public static <E> WebEndpointMapping.Builder<E> of(@Nullable E endpoint, Collection<String> patterns)
    • of

      public static <E> WebEndpointMapping.Builder<E> of(@Nullable E endpoint, String... patterns)
    • of

      public static <E> WebEndpointMapping.Builder<E> of(@Nullable WebEndpointMapping.Kind kind, @Nullable E endpoint, Collection<String> patterns)
    • of

      public static <E> WebEndpointMapping.Builder of(@Nullable WebEndpointMapping.Kind kind, @Nullable E endpoint, String... patterns)
    • getKind

      @Nonnull public WebEndpointMapping.Kind getKind()
      The kind of endpoint:
      • Servlet
      • Servlet's Filter
      • Spring WebMVC DispatcherServlet
      • Spring WebFlux DispatcherHandler
      • Customized
      Returns:
      non-null
    • getEndpoint

      @Nonnull public E getEndpoint()
      The abstract presentation of actual endpoint that may be :
      • the name of Servlet
      • the name of Servlet's Filter
      • the any handler of Spring WebMVC org.springframework.web.servlet.HandlerMapping:
        • The String presenting the name of Handler bean
        • The org.springframework.web.servlet.mvc.Controller Bean
        • The HandlerMethod could be annotated the @RequestMapping
        • The org.springframework.web.servlet.function.HandlerFunction since Spring Framework 5.2
      • the any handler of Spring WebFlux org.springframework.web.reactive.DispatcherHandler:
        • The String presenting the name of Handler bean
        • The HandlerMethod could be annotated the @RequestMapping
        • The org.springframework.web.reactive.function.server.RouterFunction since Spring Framework 5.0
      Returns:
      non-null
    • getId

      public int getId()
      The id of endpoint
      Returns:
      0 if no endpoint present
    • getSource

      @Nonnull public Object getSource()
      The source of WebEndpointMapping if present, it could be :
      • ServletContext
      • Spring WebMVC org.springframework.web.servlet.HandlerMapping
      • Spring WebFlux org.springframework.web.reactive.HandlerMapping
      , or it's non-source
      Returns:
      non-null
    • getPatterns

      @Nonnull public String[] getPatterns()
    • getMethods

      @Nonnull public String[] getMethods()
    • getParams

      @Nonnull public String[] getParams()
    • getHeaders

      @Nonnull public String[] getHeaders()
    • getConsumes

      @Nonnull public String[] getConsumes()
    • getProduces

      @Nonnull public String[] getProduces()
    • setAttribute

      public <V> WebEndpointMapping<E> setAttribute(String name, @Nullable V value)
    • getAttribute

      @Nullable public <V> V getAttribute(String name)
    • toJSON

      public String toJSON()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object