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 java.lang.ObjectThe meta-data class for Web Endpoint Mapping that could be one of these endpoints:ServletServlet's Filter- Spring WebMVC
DispatcherServlet - Spring WebFlux
DispatcherHandler - Customized
The method
getKind()can be used to identify the kind of endpoints, and the methodgetEndpoint()is an abstract presentation of actual endpoint that may be :the name of Servletthe name of Servlet's Filter- the any handler of Spring WebMVC
org.springframework.web.servlet.HandlerMapping:- The
Stringpresenting the name of Handler bean - The
org.springframework.web.servlet.mvc.ControllerBean - The
HandlerMethodcould be annotated the@RequestMapping - The
org.springframework.web.servlet.function.HandlerFunctionsince Spring Framework 5.2
- The
- the any handler of Spring WebFlux
org.springframework.web.reactive.HandlerMapping:- The
Stringpresenting the name of Handler bean - The
HandlerMethodcould be annotated the@RequestMapping - The
org.springframework.web.reactive.function.server.RouterFunctionsince Spring Framework 5.0
- The
The method
getSource()can trace the source ofWebEndpointMappingif present, it could be :ServletContext- Spring WebMVC
org.springframework.web.servlet.HandlerMapping - Spring WebFlux
org.springframework.web.reactive.HandlerMapping
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWebEndpointMapping.Builder<E>static classWebEndpointMapping.KindWebEndpointMappingKind
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringID_HEADER_NAMEThe HTTP header name forgetId()static java.lang.ObjectUNKNOWN_SOURCEThe source is unknown
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <E> WebEndpointMapping.Builder<E>customized()booleanequals(java.lang.Object o)static <E> WebEndpointMapping.Builder<E>filter()<V> VgetAttribute(java.lang.String name)java.lang.String[]getConsumes()EgetEndpoint()The abstract presentation of actual endpoint that may be :the name of Servletthe name of Servlet's Filterthe any handler of Spring WebMVCorg.springframework.web.servlet.HandlerMapping: TheStringpresenting the name of Handler bean Theorg.springframework.web.servlet.mvc.ControllerBean TheHandlerMethodcould be annotated the@RequestMappingTheorg.springframework.web.servlet.function.HandlerFunctionsince Spring Framework 5.2 the any handler of Spring WebFluxorg.springframework.web.reactive.DispatcherHandler: TheStringpresenting the name of Handler bean TheHandlerMethodcould be annotated the@RequestMappingTheorg.springframework.web.reactive.function.server.HandlerFunctionsince Spring Framework 5.0java.lang.String[]getHeaders()intgetId()The id of endpointWebEndpointMapping.KindgetKind()The kind of endpoint:ServletServlet's FilterSpring WebMVCDispatcherServletSpring WebFluxDispatcherHandlerCustomizedjava.lang.String[]getMethods()java.lang.String[]getParams()java.lang.String[]getPatterns()java.lang.String[]getProduces()java.lang.ObjectgetSource()The source ofWebEndpointMappingif present, it could be :ServletContextSpring WebMVCorg.springframework.web.servlet.HandlerMappingSpring WebFluxorg.springframework.web.reactive.HandlerMapping, or it'snon-sourceinthashCode()booleanisNegated()Get the 'negated' statusstatic <E> WebEndpointMapping.Builder<E>of(WebEndpointMapping.Kind kind)Create aWebEndpointMapping.BuilderofWebEndpointMappingwith specified kind.static <E> WebEndpointMapping.Builder<E>servlet()<V> WebEndpointMapping<E>setAttribute(java.lang.String name, V value)java.lang.StringtoJSON()java.lang.StringtoString()static <E> WebEndpointMapping.Builder<E>webflux()static <E> WebEndpointMapping.Builder<E>webmvc()
-
-
-
Field Detail
-
ID_HEADER_NAME
public static final java.lang.String ID_HEADER_NAME
The HTTP header name forgetId()- See Also:
- Constant Field Values
-
UNKNOWN_SOURCE
public static final java.lang.Object UNKNOWN_SOURCE
The source is unknown
-
-
Method Detail
-
servlet
@Nonnull public static <E> WebEndpointMapping.Builder<E> servlet() throws java.lang.IllegalArgumentException
- Type Parameters:
E- the type of endpoint- Returns:
- a
WebEndpointMapping.BuilderofWebEndpointMapping - Throws:
java.lang.IllegalArgumentException- if theendpointisnull
-
filter
@Nonnull public static <E> WebEndpointMapping.Builder<E> filter() throws java.lang.IllegalArgumentException
- Type Parameters:
E- the type of endpoint- Returns:
- a
WebEndpointMapping.BuilderofWebEndpointMapping - Throws:
java.lang.IllegalArgumentException- if theendpointisnull
-
webmvc
@Nonnull public static <E> WebEndpointMapping.Builder<E> webmvc() throws java.lang.IllegalArgumentException
- Type Parameters:
E- the type of endpoint- Returns:
- a
WebEndpointMapping.BuilderofWebEndpointMapping - Throws:
java.lang.IllegalArgumentException- if theendpointisnull
-
webflux
@Nonnull public static <E> WebEndpointMapping.Builder<E> webflux() throws java.lang.IllegalArgumentException
- Type Parameters:
E- the type of endpoint- Returns:
- a
WebEndpointMapping.BuilderofWebEndpointMapping - Throws:
java.lang.IllegalArgumentException- if theendpointisnull
-
customized
@Nonnull public static <E> WebEndpointMapping.Builder<E> customized() throws java.lang.IllegalArgumentException
- Type Parameters:
E- the type of endpoint- Returns:
- a
WebEndpointMapping.BuilderofWebEndpointMapping - Throws:
java.lang.IllegalArgumentException- if theendpointisnull
-
of
@Nonnull public static <E> WebEndpointMapping.Builder<E> of(@Nonnull WebEndpointMapping.Kind kind) throws java.lang.IllegalArgumentException
Create aWebEndpointMapping.BuilderofWebEndpointMappingwith specified kind.- Type Parameters:
E- the type of endpoint- Parameters:
kind- the kind of endpoint- Returns:
- a
WebEndpointMapping.BuilderofWebEndpointMapping - Throws:
java.lang.IllegalArgumentException- if thekindorendpointisnull
-
getKind
@Nonnull public WebEndpointMapping.Kind getKind()
The kind of endpoint:ServletServlet'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 Servletthe name of Servlet's Filter- the any handler of Spring WebMVC
org.springframework.web.servlet.HandlerMapping:- The
Stringpresenting the name of Handler bean - The
org.springframework.web.servlet.mvc.ControllerBean - The
HandlerMethodcould be annotated the@RequestMapping - The
org.springframework.web.servlet.function.HandlerFunctionsince Spring Framework 5.2
- The
- the any handler of Spring WebFlux
org.springframework.web.reactive.DispatcherHandler:- The
Stringpresenting the name of Handler bean - The
HandlerMethodcould be annotated the@RequestMapping - The
org.springframework.web.reactive.function.server.HandlerFunctionsince Spring Framework 5.0
- The
- Returns:
- non-null
-
getId
public int getId()
The id of endpoint- Returns:
- id of endpoint
-
isNegated
public boolean isNegated()
Get the 'negated' status- Returns:
falseas default
-
getSource
@Nonnull public java.lang.Object getSource()
The source ofWebEndpointMappingif present, it could be :ServletContext- Spring WebMVC
org.springframework.web.servlet.HandlerMapping - Spring WebFlux
org.springframework.web.reactive.HandlerMapping
non-source- Returns:
- non-null
-
getPatterns
@Nonnull public java.lang.String[] getPatterns()
-
getMethods
@Nonnull public java.lang.String[] getMethods()
-
getParams
@Nonnull public java.lang.String[] getParams()
-
getHeaders
@Nonnull public java.lang.String[] getHeaders()
-
getConsumes
@Nonnull public java.lang.String[] getConsumes()
-
getProduces
@Nonnull public java.lang.String[] getProduces()
-
setAttribute
public <V> WebEndpointMapping<E> setAttribute(java.lang.String name, @Nullable V value)
-
getAttribute
@Nullable public <V> V getAttribute(java.lang.String name)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toJSON
public java.lang.String toJSON()
-
-