public class BeanPopulator extends Object
Constructor and Description |
---|
BeanPopulator() |
Modifier and Type | Method and Description |
---|---|
static void |
configureFromProperties(Object bean,
Properties properties)
Deprecated.
Only used in tests
|
static void |
configureFromProperties(Object bean,
String instanceName,
Properties properties)
Examine the properties of the provided bean and update them to match the values of the corresponding
properties in the Properties.
|
static <T> T |
getDefaultInstance(Class<T> beanClass) |
static <T> T |
getDefaultInstance(Class<T> beanClass,
Properties properties) |
static <T> T |
getNamedInstance(Class<T> beanClass,
String name) |
static String |
printBean(Object bean) |
static String |
printState()
Render the state of the known bean instances as text.
|
public static <T> T getDefaultInstance(Class<T> beanClass) throws RuntimeException
RuntimeException
public static <T> T getDefaultInstance(Class<T> beanClass, Properties properties) throws RuntimeException
RuntimeException
public static <T> T getNamedInstance(Class<T> beanClass, String name) throws RuntimeException
RuntimeException
public static void configureFromProperties(Object bean, Properties properties) throws Exception
Exception
public static void configureFromProperties(Object bean, String instanceName, Properties properties) throws Exception
bean
- a JavaBean, the target of the property updates and source for defaults.instanceName
- the (optional, use null for default) name for the bean instance.properties
- a Properties object, the source of the configuration overrides.Exception
- if the configuration of the bean fails.public static String printState()
Copyright © 2021 JBoss by Red Hat. All rights reserved.