Top Description Fields Constructors Methods
com.univocity.parsers.common.beans

public final Class BeanHelper

extends Object
Class Inheritance
Imports
java.lang.ref.*, java.lang.reflect.*, java.util.*, java.util.concurrent.*

Helper class used to obtain property descriptors from annotated java beans whose values are set via reflection. This class was implemented to eliminate direct compile-time dependency with java.beans.Introspector and other classes in the java.beans.* package. This is required to allow Android developers to use univocity-parsers. Android developers should add have openbeans-1.0.jar in their classpath to be able to use univocity-parsers. When available, the classes from package com.googlecode.openbeans.* will be used, otherwise the bean introspection classes classes from java.beans.* package will be loaded. If everything fails, then the parser will try to manipulate fields in annotated java beans directly, instead of using their getters and setters.

Field Summary

Modifier and TypeField and Description
private static final Method
private static final Map<Class<?>, WeakReference<PropertyWrapper[]>>
private static final PropertyWrapper[]
private static final Class<?>
pack-priv static Method
pack-priv static Method
pack-priv static Method
private static final Method

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static Class<?>
private static Method
private static Method
getMethod(String methodName, Method method, boolean fromComponentType)

public static PropertyWrapper[]

Returns:

an array of all property descriptors of the given class. Might be empty.
getPropertyDescriptors
(Class<?>
the class whose property descriptors should be returned
beanClass
)

Returns the property descriptors of all properties available from a class

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beanInfoMethodback to summary
private static final Method beanInfoMethod
descriptorsback to summary
private static final Map<Class<?>, WeakReference<PropertyWrapper[]>> descriptors
EMPTYback to summary
private static final PropertyWrapper[] EMPTY
introspectorClassback to summary
private static final Class<?> introspectorClass
PROPERTY_NAME_METHODback to summary
pack-priv static Method PROPERTY_NAME_METHOD
PROPERTY_READ_METHODback to summary
pack-priv static Method PROPERTY_READ_METHOD
PROPERTY_WRITE_METHODback to summary
pack-priv static Method PROPERTY_WRITE_METHOD
propertyDescriptorMethodback to summary
private static final Method propertyDescriptorMethod

Constructor Detail

BeanHelperback to summary
private BeanHelper()

Method Detail

findIntrospectorImplementationClassback to summary
private static Class<?> findIntrospectorImplementationClass()
getBeanInfoMethodback to summary
private static Method getBeanInfoMethod()
getMethodback to summary
private static Method getMethod(String methodName, Method method, boolean fromComponentType)
getPropertyDescriptorsback to summary
public static PropertyWrapper[] getPropertyDescriptors(Class<?> beanClass)

Returns the property descriptors of all properties available from a class

Parameters
beanClass:Class<?>

the class whose property descriptors should be returned

Returns:PropertyWrapper[]

an array of all property descriptors of the given class. Might be empty.