类 RegistrationBean
- java.lang.Object
- org.springframework.boot.web.servlet.RegistrationBean
- 所有已实现的接口:
ServletContextInitializer
,org.springframework.core.Ordered
- 直接已知子类:
DelegatingFilterProxyRegistrationBean
,FilterRegistrationBean
,ServletListenerRegistrationBean
,ServletRegistrationBean
public abstract class RegistrationBean extends Object implements ServletContextInitializer, org.springframework.core.Ordered
Base class for Servlet 3.0+ based registration beans.
构造器概要
构造器 构造器 说明 RegistrationBean()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
addInitParameter(String name, String value)
Add a single init-parameter, replacing any existing parameter with the same name.protected void
configure(javax.servlet.Registration.Dynamic registration)
Configure registration base settings.Map<String,String>
getInitParameters()
Returns a mutable Map of the registration init-parameters.protected String
getOrDeduceName(Object value)
Deduces the name for this registration.int
getOrder()
Get the order of the registration bean.boolean
isAsyncSupported()
Returns if asynchronous operations are support for this registration.boolean
isEnabled()
Return if the registration is enabled.void
setAsyncSupported(boolean asyncSupported)
Sets if asynchronous operations are support for this registration.void
setEnabled(boolean enabled)
Flag to indicate that the registration is enabled.void
setInitParameters(Map<String,String> initParameters)
Set init-parameters for this registration.void
setName(String name)
Set the name of this registration.void
setOrder(int order)
Set the order of the registration bean.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.boot.web.servlet.ServletContextInitializer
onStartup
构造器详细资料
RegistrationBean
public RegistrationBean()
方法详细资料
setName
public void setName(String name)
Set the name of this registration. If not specified the bean name will be used.- 参数:
name
- the name of the registration
setAsyncSupported
public void setAsyncSupported(boolean asyncSupported)
Sets if asynchronous operations are support for this registration. If not specified defaults totrue
.- 参数:
asyncSupported
- if async is supported
isAsyncSupported
public boolean isAsyncSupported()
Returns if asynchronous operations are support for this registration.- 返回:
- if async is supported
setEnabled
public void setEnabled(boolean enabled)
Flag to indicate that the registration is enabled.- 参数:
enabled
- the enabled to set
isEnabled
public boolean isEnabled()
Return if the registration is enabled.- 返回:
- if enabled (default
true
)
setInitParameters
public void setInitParameters(Map<String,String> initParameters)
Set init-parameters for this registration. Calling this method will replace any existing init-parameters.- 参数:
initParameters
- the init parameters- 另请参阅:
getInitParameters()
,addInitParameter(java.lang.String, java.lang.String)
getInitParameters
public Map<String,String> getInitParameters()
Returns a mutable Map of the registration init-parameters.- 返回:
- the init parameters
addInitParameter
public void addInitParameter(String name, String value)
Add a single init-parameter, replacing any existing parameter with the same name.- 参数:
name
- the init-parameter namevalue
- the init-parameter value
getOrDeduceName
protected final String getOrDeduceName(Object value)
Deduces the name for this registration. Will return user specified name or fallback to convention based naming.- 参数:
value
- the object used for convention based names- 返回:
- the deduced name
configure
protected void configure(javax.servlet.Registration.Dynamic registration)
Configure registration base settings.- 参数:
registration
- the registration
setOrder
public void setOrder(int order)
Set the order of the registration bean.- 参数:
order
- the order
getOrder
public int getOrder()
Get the order of the registration bean.- 指定者:
getOrder
在接口中org.springframework.core.Ordered
- 返回:
- the order