public class BeanWrapperContext extends Object
Performs introspection and holds metadata information about a class used by the JuffrouBeanWrapper
.
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) |
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() |
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.propertyValue
- the value of thisProperty or null. If present, propertyValue.getClass() will be used to infer the type of the underlying field.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
- name of the property to get the type of.public Class<?> getBeanClass()
public Object newBeanInstance()
public Map<String,BeanFieldHandler> getFields()
public Map<TypeVariable<?>,Type> getTypeArgumentsMap()
public BeanWrapperFactory getFactory()
Copyright © 2011–2020 Juffrou. All rights reserved.