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 this and save the introspection overhead.
This class is thread safe.
| Constructor and Description |
|---|
BeanWrapperContext(BeanWrapperContextHierarchy hierarchy,
Class clazz) |
BeanWrapperContext(BeanWrapperContextHierarchy hierarchy,
Class clazz,
Type... types) |
BeanWrapperContext(Class clazz) |
BeanWrapperContext(Class clazz,
Type... types) |
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
getBeanClass()
Get the wrapped bean class
|
BeanContextCreator<? extends BeanWrapperContext> |
getBeanContextCreator() |
BeanFieldHandler |
getBeanFieldHandler(String propertyName) |
BeanInstanceCreator |
getBeanInstanceCreator() |
Map<String,BeanFieldHandler> |
getFields() |
BeanWrapperContextHierarchy |
getHierarchyContext() |
BeanWrapperContext |
getNestedContext(String thisProperty)
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 |
setBeanContextCreator(BeanContextCreator<? extends BeanWrapperContext> beanContextCreator) |
void |
setBeanInstanceCreator(BeanInstanceCreator beanInstanceCreator)
The bean wrapper creates new instances using Class.newIntance().
|
public BeanWrapperContext(Class clazz)
public BeanWrapperContext(BeanWrapperContextHierarchy hierarchy, Class clazz)
public BeanWrapperContext(BeanWrapperContextHierarchy hierarchy, Class clazz, Type... types)
public BeanWrapperContext getNestedContext(String thisProperty)
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 BeanWrapperContextHierarchy getHierarchyContext()
public BeanInstanceCreator getBeanInstanceCreator()
public void setBeanInstanceCreator(BeanInstanceCreator beanInstanceCreator)
beanInstanceCreator - public BeanContextCreator<? extends BeanWrapperContext> getBeanContextCreator()
public void setBeanContextCreator(BeanContextCreator<? extends BeanWrapperContext> beanContextCreator)
Copyright © 2011-2013. All Rights Reserved.