net.sf.juffrou.reflect.BeanWrapperFactory Maven / Gradle / Ivy
Show all versions of juffrou-reflect Show documentation
package net.sf.juffrou.reflect;
import java.lang.reflect.Type;
public interface BeanWrapperFactory {
/**
* Retrieves a BeanWrapperContext for java bean class.
*
* If the BeanWrapperContext is not in cache then creates a new one.
*
* @param clazz
* the bean class to inspect
* @return a BeanWrapperContext with introspection information about the specified class.
* @see {@link #getBeanWrapperContext(Class, Type...)}
*/
BeanWrapperContext getBeanWrapperContext(Class clazz);
/**
* Retrieves a BeanWrapperContext for a parameterized (generic) java bean class.
*
* If the BeanWrapperContext is not in cache then creates a new one.
*
* @param clazz
* the generic bean class to inspect.
* @param types
* the parameters that defined the generic bean class.
* @return a BeanWrapperContext with introspection information about the specified class.
*/
BeanWrapperContext getBeanWrapperContext(Class clazz, Type... types);
/**
* Construct a bean wrapper around a class.
*
* Bean instances will be instances of that class and will be created only when necessary.
* Try to use a cached BeanWrapperContext to save introspection time.
*
* @param clazz
* class to instantiate the wrapped bean
*/
JuffrouBeanWrapper getBeanWrapper(Class clazz);
/**
* Construct a bean wrapper around an existing bean instance.
*
* Will try to use a cached BeanWrapperContext to save introspection time.
*
* @param instance
* the bean object to be wrapped
*/
JuffrouBeanWrapper getBeanWrapper(Object instance);
BeanInstanceBuilder getBeanInstanceBuilder();
}