Class RegistrationWebEndpointMappingFactory<R extends javax.servlet.Registration>
- java.lang.Object
-
- io.microsphere.spring.web.metadata.AbstractWebEndpointMappingFactory<java.lang.String>
-
- io.microsphere.spring.web.metadata.RegistrationWebEndpointMappingFactory<R>
-
- Type Parameters:
R
- The type ofRegistrationWebEndpointMappingFactory
- All Implemented Interfaces:
WebEndpointMappingFactory<java.lang.String>
- Direct Known Subclasses:
FilterRegistrationWebEndpointMappingFactory
,ServletRegistrationWebEndpointMappingFactory
public abstract class RegistrationWebEndpointMappingFactory<R extends javax.servlet.Registration> extends AbstractWebEndpointMappingFactory<java.lang.String>
The abstract class ofAbstractWebEndpointMappingFactory
for ServletRegistration
- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
AbstractWebEndpointMappingFactory
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.servlet.ServletContext
servletContext
-
Constructor Summary
Constructors Constructor Description RegistrationWebEndpointMappingFactory(javax.servlet.ServletContext servletContext)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
contribute(java.lang.String endpoint, javax.servlet.ServletContext servletContext, WebEndpointMapping.Builder<java.lang.String> builder)
Contribute theWebEndpointMapping.Builder
to create an instance ofWebEndpointMapping
protected WebEndpointMapping<java.lang.String>
doCreate(java.lang.String endpoint)
protected abstract java.util.Collection<java.lang.String>
getPatterns(R registration)
Get the patterns ofRegistration
protected abstract R
getRegistration(java.lang.String name, javax.servlet.ServletContext servletContext)
boolean
supports(java.lang.String endpoint)
Current factory supports the specified endpoint or not-
Methods inherited from class io.microsphere.spring.web.metadata.AbstractWebEndpointMappingFactory
create
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.microsphere.spring.web.metadata.WebEndpointMappingFactory
getSourceType
-
-
-
-
Method Detail
-
supports
public final boolean supports(java.lang.String endpoint)
Description copied from interface:WebEndpointMappingFactory
Current factory supports the specified endpoint or not- Parameters:
endpoint
- could be one of these :ServletRegistration
FilterRegistration
org.springframework.web.servlet.mvc.method.RequestMappingInfo
org.springframework.web.reactive.result.method.RequestMappingInfo
- Returns:
true
if supports,false
otherwise
-
doCreate
protected final WebEndpointMapping<java.lang.String> doCreate(java.lang.String endpoint) throws java.lang.Throwable
- Specified by:
doCreate
in classAbstractWebEndpointMappingFactory<java.lang.String>
- Throws:
java.lang.Throwable
-
getRegistration
@NonNull protected abstract R getRegistration(java.lang.String name, javax.servlet.ServletContext servletContext)
- Parameters:
name
- the name ofRegistration
servletContext
-ServletContext
- Returns:
- The
Registration
-
getPatterns
@NonNull protected abstract java.util.Collection<java.lang.String> getPatterns(R registration)
Get the patterns ofRegistration
- Parameters:
registration
-Registration
- Returns:
- non-null
-
contribute
protected void contribute(java.lang.String endpoint, javax.servlet.ServletContext servletContext, WebEndpointMapping.Builder<java.lang.String> builder) throws java.lang.Throwable
Contribute theWebEndpointMapping.Builder
to create an instance ofWebEndpointMapping
- Parameters:
endpoint
- the name ofRegistration
servletContext
-ServletContext
builder
-WebEndpointMapping.Builder
- Throws:
java.lang.Throwable
- an error if contribution failed
-
-