Package net.sf.jasperreports.engine.data
Class JRAbstractBeanDataSource
- java.lang.Object
-
- net.sf.jasperreports.engine.data.JRAbstractBeanDataSource
-
- All Implemented Interfaces:
JRDataSource,JRRewindableDataSource
- Direct Known Subclasses:
BookmarksFlatDataSource,JRBeanArrayDataSource,JRBeanCollectionDataSource,JRJpaDataSource
public abstract class JRAbstractBeanDataSource extends Object implements JRRewindableDataSource
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classJRAbstractBeanDataSource.DefaultPropertyNameProvider
-
Field Summary
Fields Modifier and Type Field Description static StringCURRENT_BEAN_MAPPINGField mapping that produces the current bean.static StringEXCEPTION_MESSAGE_KEY_BEAN_FIELD_VALUE_NOT_RETRIEVEDstatic StringPROPERTY_JAVABEAN_FIELD_PROPERTYProperty specifying the JavaBean property name for the dataset field.protected net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.PropertyNameProviderpropertyNameProvider
-
Constructor Summary
Constructors Constructor Description JRAbstractBeanDataSource(boolean isUseFieldDescription)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static ObjectgetBeanProperty(Object bean, String propertyName)protected ObjectgetFieldValue(Object bean, JRField field)protected StringgetPropertyName(JRField field)protected static booleanisCurrentBeanMapping(String propertyName)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jasperreports.engine.JRDataSource
getFieldValue, next
-
Methods inherited from interface net.sf.jasperreports.engine.JRRewindableDataSource
moveFirst
-
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_BEAN_FIELD_VALUE_NOT_RETRIEVED
public static final String EXCEPTION_MESSAGE_KEY_BEAN_FIELD_VALUE_NOT_RETRIEVED
- See Also:
- Constant Field Values
-
PROPERTY_JAVABEAN_FIELD_PROPERTY
public static final String PROPERTY_JAVABEAN_FIELD_PROPERTY
Property specifying the JavaBean property name for the dataset field.- See Also:
- Constant Field Values
-
CURRENT_BEAN_MAPPING
public static final String CURRENT_BEAN_MAPPING
Field mapping that produces the current bean. If the field name/description matches this constant (the case is important), the data source will return the current bean as the field value.- See Also:
- Constant Field Values
-
propertyNameProvider
protected net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.PropertyNameProvider propertyNameProvider
-
-
Method Detail
-
getFieldValue
protected Object getFieldValue(Object bean, JRField field) throws JRException
- Throws:
JRException
-
getBeanProperty
protected static Object getBeanProperty(Object bean, String propertyName) throws JRException
- Throws:
JRException
-
isCurrentBeanMapping
protected static boolean isCurrentBeanMapping(String propertyName)
-
-