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 ofAbstractWebEndpointMappingFactoryfor ServletRegistration- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
AbstractWebEndpointMappingFactory
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.servlet.ServletContextservletContext-
Fields inherited from class io.microsphere.spring.web.metadata.AbstractWebEndpointMappingFactory
logger
-
-
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 voidcontribute(java.lang.String endpoint, javax.servlet.ServletContext servletContext, WebEndpointMapping.Builder<java.lang.String> builder)Contribute theWebEndpointMapping.Builderto create an instance ofWebEndpointMappingprotected WebEndpointMapping<java.lang.String>doCreate(java.lang.String endpoint)protected WebEndpointMapping.KindgetKind(R registration)protected abstract java.util.Collection<java.lang.String>getMethods(R registration)Gets the HTTP methods of the given registrationprotected abstract java.util.Collection<java.lang.String>getPatterns(R registration)Get the patterns ofRegistrationprotected abstract RgetRegistration(java.lang.String name, javax.servlet.ServletContext servletContext)booleansupports(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:WebEndpointMappingFactoryCurrent factory supports the specified endpoint or not- Parameters:
endpoint- could be one of these :ServletRegistrationFilterRegistrationorg.springframework.web.servlet.mvc.method.RequestMappingInfoorg.springframework.web.reactive.result.method.RequestMappingInfo
- Returns:
trueif supports,falseotherwise
-
doCreate
protected final WebEndpointMapping<java.lang.String> doCreate(java.lang.String endpoint) throws java.lang.Throwable
- Specified by:
doCreatein classAbstractWebEndpointMappingFactory<java.lang.String>- Throws:
java.lang.Throwable
-
getKind
protected WebEndpointMapping.Kind getKind(R registration)
-
getMethods
@Nonnull protected abstract java.util.Collection<java.lang.String> getMethods(R registration)
Gets the HTTP methods of the given registration- Parameters:
registration- the registration- Returns:
- the HTTP methods of the given registration
-
getRegistration
@Nonnull protected abstract R getRegistration(java.lang.String name, javax.servlet.ServletContext servletContext)
- Parameters:
name- the name ofRegistrationservletContext-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.ThrowableContribute theWebEndpointMapping.Builderto create an instance ofWebEndpointMapping- Parameters:
endpoint- the name ofRegistrationservletContext-ServletContextbuilder-WebEndpointMapping.Builder- Throws:
java.lang.Throwable- an error if contribution failed
-
-