public final class BackofficeSpringUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsBean(String name)
Checks if bean for the given name exists.
|
static <T> T |
createClassInstance(String className,
Class<T> clazz)
Loads a class by class name using cockpit module class loader and returns a new instance of the class.
|
static <T> Map<String,T> |
getAllBeans(Class<T> clazz)
Gets all beans for given class.
|
static <T> Map<String,T> |
getAllBeans(Class<T> clazz,
boolean respectAutowireFlag)
Gets all beans for given class can respect the autowire-candidate flag for bean.
|
static CockpitApplicationContext |
getApplicationContext()
Gets the cockpit module application context, if existing, otherwise null.
|
static <C> C |
getBean(String name)
Gets the bean for the given name.
|
static <C> C |
getBean(String name,
Class<? extends C> clz)
Gets the bean for the given name and class.
|
static <C> C |
getBean(String name,
Object... args)
Allows to get a bean and provide constructor args in runtime.
|
static <T> T |
getBeanForField(String beanName,
T fieldValue) |
protected static boolean |
isAutowireCandidate(org.springframework.context.ApplicationContext applicationContext,
String beanName) |
static <T> T |
loadClass(String className)
Loads a class by class name using cockpit module class loader and returns it.
|
public static boolean containsBean(String name)
SpringUtil.getBean(String).public static <C> C getBean(String name)
SpringUtil.getBean(String).public static <C> C getBean(String name, Object... args)
name - bean nameargs - constructor args which can be passed to beanpublic static <C> C getBean(String name, Class<? extends C> clz)
SpringUtil.getBean(String, Class).public static <T> Map<String,T> getAllBeans(Class<T> clazz)
public static <T> Map<String,T> getAllBeans(Class<T> clazz, boolean respectAutowireFlag)
clazz - - given classrespectAutowireFlag - - whether autowire-candidate attribute should be respectedprotected static boolean isAutowireCandidate(org.springframework.context.ApplicationContext applicationContext,
String beanName)
public static CockpitApplicationContext getApplicationContext()
public static <T> T createClassInstance(String className, Class<T> clazz)
T - type of returned instanceclassName - class name to create.clazz - class used for generalizationpublic static <T> T loadClass(String className)
className - class name to create.public static <T> T getBeanForField(String beanName, T fieldValue)
Copyright © 2018. All rights reserved.