public final class SpringApplicationX extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.springframework.context.ConfigurableApplicationContext |
applicationContext
Current Spring Application's applicationContext
|
static String |
applicationPackage
Spring Application mainApplicationClass's package name
|
static org.springframework.core.env.ConfigurableEnvironment |
environment
Spring Application environment
ConfigurableEnvironment
|
static boolean |
isDebugging
Spring Application debugging status
|
static boolean |
isRunningAsJar
whether current application running as a jar or yet
|
static Class<?> |
mainApplicationClass
Spring Application mainApplicationClass
|
static org.springframework.boot.SpringApplication |
springApplication
Current Spring Application
|
static String |
springBootVersion
Spring Boot Version
|
static String |
springBootVersionX
Spring Boot Version
|
| Constructor and Description |
|---|
SpringApplicationX() |
| Modifier and Type | Method and Description |
|---|---|
static void |
applicationInfo()
Spring application info
|
static <T> T |
getBean(Class<T> clazz)
Return the bean instance that uniquely matches the given object type, if any.
|
static org.springframework.context.ConfigurableApplicationContext |
run(Class<?>[] primarySources,
String[] args)
Static helper that can be used to run a
SpringApplication from the
specified sources using default settings and user supplied arguments. |
static org.springframework.context.ConfigurableApplicationContext |
run(Class<?> primarySource,
String... args)
Static helper that can be used to run a
SpringApplication from the
specified source using default settings. |
public static org.springframework.boot.SpringApplication springApplication
public static org.springframework.context.ConfigurableApplicationContext applicationContext
public static boolean isDebugging
public static org.springframework.core.env.ConfigurableEnvironment environment
public static Class<?> mainApplicationClass
public static String applicationPackage
public static String springBootVersion
public static String springBootVersionX
public static boolean isRunningAsJar
public static org.springframework.context.ConfigurableApplicationContext run(Class<?> primarySource, String... args)
SpringApplication from the
specified source using default settings.primarySource - the primary source to loadargs - the application arguments (usually passed from a Java main method)ApplicationContextpublic static org.springframework.context.ConfigurableApplicationContext run(Class<?>[] primarySources, String[] args)
SpringApplication from the
specified sources using default settings and user supplied arguments.primarySources - the primary sources to loadargs - the application arguments (usually passed from a Java main method)ApplicationContextpublic static <T> T getBean(Class<T> clazz)
This method goes into ListableBeanFactory by-type lookup territory
but may also be translated into a conventional by-name lookup based on the name
of the given type. For more extensive retrieval operations across sets of beans,
use ListableBeanFactory and/or BeanFactoryUtils.
org.springframework.beans.factory.NoSuchBeanDefinitionException - if no bean of the given type was foundorg.springframework.beans.factory.NoUniqueBeanDefinitionException - if more than one bean of the given type was foundorg.springframework.beans.BeansException - if the bean could not be createdListableBeanFactorypublic static void applicationInfo()
Copyright © 2021. All rights reserved.