public class ApplicationBuilder
extends org.springframework.boot.builder.SpringApplicationBuilder
| 限定符和类型 | 字段和说明 |
|---|---|
protected org.springframework.boot.SpringApplication |
application |
protected Class<?> |
applicationClass
程序主类
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
ApplicationBuilder(Class<?>... sources) |
| 限定符和类型 | 方法和说明 |
|---|---|
ApplicationBuilder |
addApplicationEventClient(ApplicationEventClient applicationEventClient)
添加程序事件监听
|
ApplicationBuilder |
addApplicationEventLoad(ApplicationEventLoad applicationEventLoad)
添加容器启动监听
|
ApplicationBuilder |
addHandlerMethodArgumentResolver(Class<? extends org.springframework.web.method.support.HandlerMethodArgumentResolver> cls)
添加参数解析器
|
ApplicationBuilder |
addHttpMessageConverter(org.springframework.http.converter.HttpMessageConverter<?> httpMessageConverter)
添加响应转换器
|
ApplicationBuilder |
addInterceptor(Class<? extends BaseInterceptor> cls)
添加默认拦截器
|
ApplicationBuilder |
addLoadPage(String packageName)
给程序添加默认包
|
static ApplicationBuilder |
createBuilder(Class<?>... sources)
创建启动对象
|
static Object |
get(String key)
根据参数名 获取值
|
static <R> R |
getActiveApplication(Function<ApplicationBuilder,R> function) |
Set<ApplicationEventClient> |
getApplicationEventClients() |
Set<ApplicationEventLoad> |
getApplicationEventLoads() |
static org.springframework.core.env.Environment |
getEnvironment() |
Set<Class<? extends org.springframework.web.method.support.HandlerMethodArgumentResolver>> |
getHandlerMethodArgumentResolvers() |
Set<org.springframework.http.converter.HttpMessageConverter<?>> |
getHttpMessageConverters() |
Set<Class<? extends BaseInterceptor>> |
getInterceptorClass() |
static boolean |
isRestart()
判断是否已热部署
|
ApplicationBuilder |
loadProperties(String packageName)
加载配置
|
static void |
put(String key,
Object value)
添加预置参数
|
addCommandLineProperties, application, banner, bannerMode, beanNameGenerator, build, build, child, context, contextClass, createSpringApplication, environment, headless, initializers, listeners, logStartupInfo, main, parent, parent, profiles, properties, properties, properties, registerShutdownHook, resourceLoader, run, setAddConversionService, sibling, sibling, sources, webprotected Class<?> applicationClass
protected org.springframework.boot.SpringApplication application
public static ApplicationBuilder createBuilder(Class<?>... sources) throws Exception
sources - sourcesNoSuchFieldException - eIllegalAccessException - eExceptionpublic static org.springframework.core.env.Environment getEnvironment()
public static <R> R getActiveApplication(Function<ApplicationBuilder,R> function)
public Set<ApplicationEventLoad> getApplicationEventLoads()
public Set<Class<? extends BaseInterceptor>> getInterceptorClass()
public Set<org.springframework.http.converter.HttpMessageConverter<?>> getHttpMessageConverters()
public Set<Class<? extends org.springframework.web.method.support.HandlerMethodArgumentResolver>> getHandlerMethodArgumentResolvers()
public Set<ApplicationEventClient> getApplicationEventClients()
public ApplicationBuilder addHttpMessageConverter(org.springframework.http.converter.HttpMessageConverter<?> httpMessageConverter)
httpMessageConverter - converterpublic ApplicationBuilder addInterceptor(Class<? extends BaseInterceptor> cls)
cls - clspublic ApplicationBuilder addApplicationEventLoad(ApplicationEventLoad applicationEventLoad)
applicationEventLoad - 监听接口public ApplicationBuilder addApplicationEventClient(ApplicationEventClient applicationEventClient)
applicationEventClient - 监听接口回调public ApplicationBuilder addHandlerMethodArgumentResolver(Class<? extends org.springframework.web.method.support.HandlerMethodArgumentResolver> cls)
cls - clspublic ApplicationBuilder addLoadPage(String packageName) throws NoSuchFieldException, IllegalAccessException
packageName - 包名NoSuchFieldException - eIllegalAccessException - epublic static boolean isRestart()
public ApplicationBuilder loadProperties(String packageName) throws Exception
packageName - 指定包名Exception - eCopyright © 2017–2021. All rights reserved.