Class ApplicationContextHelper
-
- All Implemented Interfaces:
public class ApplicationContextHelperInit on ApplicationPreparedEvent
- Since:
2022-08-12
trydofor
-
-
Field Summary
Fields Modifier and Type Field Description public static ConfigurableApplicationContextcontextpublic static ConfigurableEnvironmentenvironmentpublic final static StringPropertySourceUnsupportedpublic final static StringPropertySourceDelimiter
-
Method Summary
Modifier and Type Method Description static ConfigurableApplicationContextgetContext()static ConfigurableEnvironmentgetEnvironment()static booleanisPrepared()whether this helper is prepared static StringgetApplicationName()static StringgetProperties(String name)static <T> TgetProperties(String name, Class<T> type)static Map<String, String>listProperties()Get all keys and valid values in order of appearance. static Map<String, String>listPropertiesKeys()Show keys and its properties static Map<String, List<String>>listPropertySource()Get the PropertySources and the keys within them, the keys can be duplicated as the files can be cascaded. static voidwalkPropertySource(String root, @Param.Out() Map<String, List<String>> srcKey, PropertySource<out Object> src)Use to investigate the relationship between source and key, return source:source2#key to key mapping static <T> TgetBean(String name)static <T> TgetBean(Class<T> type)static <T> ObjectProvider<T>getBeanProvider(Class<T> type)static <T> ObjectProvider<T>getBeanProvider(ResolvableType type)static <T> SingletonSupplier<T>getSingletonSupplier(Class<T> type)static <T> SingletonSupplier<T>getSingletonSupplier(Class<T> type, Supplier<T> elze)static <T> SingletonSupplier<List<T>>getSingletonSupplierOfList(Class<T> type)SingletonSupplier of ordered bean list static <T> SingletonSupplier<List<T>>getSingletonSupplierOfList(Class<T> type, Supplier<List<T>> elze)SingletonSupplier of ordered bean list, elze if empty static <T> SingletonSupplier<Map<String, T>>getSingletonSupplierOfMap(Class<T> type)SingletonSupplier of bean and its name map static <T> SingletonSupplier<Map<String, T>>getSingletonSupplierOfMap(Class<T> type, Supplier<Map<String, T>> elze)SingletonSupplier of bean and its name map, elze if empty static StringgetMessage(String code, Locale locale, Array<Object> arg)static ResourcegetResource(String local)static Array<Resource>getResources(String local)-
-
Method Detail
-
getContext
@NotNull() static ConfigurableApplicationContext getContext()
-
getEnvironment
@NotNull() static ConfigurableEnvironment getEnvironment()
-
isPrepared
static boolean isPrepared()
whether this helper is prepared
-
getApplicationName
@NotNull() static String getApplicationName()
-
getProperties
static String getProperties(String name)
-
getProperties
static <T> T getProperties(String name, Class<T> type)
-
listProperties
@NotNull() static Map<String, String> listProperties()
Get all keys and valid values in order of appearance.
-
listPropertiesKeys
@NotNull() static Map<String, String> listPropertiesKeys()
Show keys and its properties
-
listPropertySource
@NotNull() static Map<String, List<String>> listPropertySource()
Get the PropertySources and the keys within them, the keys can be duplicated as the files can be cascaded.
-
walkPropertySource
static void walkPropertySource(String root, @Param.Out() Map<String, List<String>> srcKey, PropertySource<out Object> src)
Use to investigate the relationship between source and key, return source:source2#key to key mapping
-
getBeanProvider
@NotNull() static <T> ObjectProvider<T> getBeanProvider(Class<T> type)
-
getBeanProvider
@NotNull() static <T> ObjectProvider<T> getBeanProvider(ResolvableType type)
-
getSingletonSupplier
@NotNull() static <T> SingletonSupplier<T> getSingletonSupplier(Class<T> type)
-
getSingletonSupplier
@NotNull() static <T> SingletonSupplier<T> getSingletonSupplier(Class<T> type, Supplier<T> elze)
-
getSingletonSupplierOfList
@NotNull() static <T> SingletonSupplier<List<T>> getSingletonSupplierOfList(Class<T> type)
SingletonSupplier of ordered bean list
-
getSingletonSupplierOfList
@NotNull() static <T> SingletonSupplier<List<T>> getSingletonSupplierOfList(Class<T> type, Supplier<List<T>> elze)
SingletonSupplier of ordered bean list, elze if empty
-
getSingletonSupplierOfMap
@NotNull() static <T> SingletonSupplier<Map<String, T>> getSingletonSupplierOfMap(Class<T> type)
SingletonSupplier of bean and its name map
-
getSingletonSupplierOfMap
@NotNull() static <T> SingletonSupplier<Map<String, T>> getSingletonSupplierOfMap(Class<T> type, Supplier<Map<String, T>> elze)
SingletonSupplier of bean and its name map, elze if empty
-
getResource
static Resource getResource(String local)
-
getResources
@NotNull() static Array<Resource> getResources(String local)
-
-
-
-