public class BeanWrapperContext extends Object
Performs introspection and holds metadata information about a class used by the BeanWrapper.
If you have to create several BeanWrappers for the same java class, use BeanWrapperContext and save the introspection overhead.
This class is thread safe.
| Modifier | Constructor and Description |
|---|---|
protected |
BeanWrapperContext(BeanWrapperFactory factory,
Class clazz,
Type... types) |
| Modifier and Type | Method and Description |
|---|---|
static BeanWrapperContext |
create(Class clazz) |
static BeanWrapperContext |
create(Class clazz,
Type... types) |
Class<?> |
getBeanClass()
Get the wrapped bean class
|
BeanFieldHandler |
getBeanFieldHandler(String propertyName) |
BeanInstanceBuilder |
getBeanInstanceBuilder() |
BeanWrapperFactory |
getFactory() |
Map<String,BeanFieldHandler> |
getFields() |
BeanWrapperContext |
getNestedContext(String thisProperty,
Object propertyValue)
Obtains the BeanWrapperContext that corresponds to the bean type of this property type.
|
Type |
getType(String propertyName)
Gets the type of a property in the wrapped bean.
|
Map<TypeVariable<?>,Type> |
getTypeArgumentsMap() |
Object |
newBeanInstance() |
void |
setBeanContextBuilder(BeanContextBuilder beanContextBuilder) |
void |
setBeanInstanceBuilder(BeanInstanceBuilder beanInstanceBuilder)
The bean wrapper creates new instances using Class.newIntance().
|
protected BeanWrapperContext(BeanWrapperFactory factory, Class clazz, Type... types)
public static final BeanWrapperContext create(Class clazz)
public static final BeanWrapperContext create(Class clazz, Type... types)
public BeanWrapperContext getNestedContext(String thisProperty, Object propertyValue)
thisProperty - property name in this bean wrapper context (bean class). It must be of bean type.public BeanFieldHandler getBeanFieldHandler(String propertyName)
public Type getType(String propertyName)
getType("pro1.prop2") will get the type of prop2 from the nested bean referenced by
prop1.propertyName - public Class<?> getBeanClass()
public Object newBeanInstance()
public Map<String,BeanFieldHandler> getFields()
public Map<TypeVariable<?>,Type> getTypeArgumentsMap()
public BeanWrapperFactory getFactory()
public BeanInstanceBuilder getBeanInstanceBuilder()
public void setBeanInstanceBuilder(BeanInstanceBuilder beanInstanceBuilder)
beanInstanceBuilder - public void setBeanContextBuilder(BeanContextBuilder beanContextBuilder)
Copyright © 2011-2013. All Rights Reserved.