Package net.sf.jasperreports.engine.data
Class JRAbstractTextDataSource
- java.lang.Object
-
- net.sf.jasperreports.engine.data.JRAbstractTextDataSource
-
- All Implemented Interfaces:
JRDataSource
- Direct Known Subclasses:
AbstractXlsDataSource
,AbstractXmlDataSource
,JRCsvDataSource
,JsonDataSource
,JsonQLDataSource
public abstract class JRAbstractTextDataSource extends Object implements JRDataSource
Abstract text data source, containing methods used to parse text data into numerical or date values.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXCEPTION_MESSAGE_KEY_CANNOT_CONVERT_FIELD_TYPE
static String
EXCEPTION_MESSAGE_KEY_CANNOT_MODIFY_PROPERTIES_AFTER_START
static String
EXCEPTION_MESSAGE_KEY_NODE_NOT_AVAILABLE
static String
EXCEPTION_MESSAGE_KEY_NULL_DOCUMENT
static String
EXCEPTION_MESSAGE_KEY_NULL_SELECT_EXPRESSION
static String
EXCEPTION_MESSAGE_KEY_UNKNOWN_COLUMN_NAME
static String
EXCEPTION_MESSAGE_KEY_UNKNOWN_NUMBER_TYPE
-
Constructor Summary
Constructors Modifier Constructor Description protected
JRAbstractTextDataSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
convertNumber(Number number, Class<?> valueClass)
protected Object
convertStringValue(String text, Class<?> valueClass)
protected org.apache.commons.beanutils.locale.LocaleConvertUtilsBean
getConvertBean()
String
getDatePattern()
Locale
getLocale()
String
getNumberPattern()
TextDataSourceAttributes
getTextAttributes()
TimeZone
getTimeZone()
void
setDatePattern(String datePattern)
void
setLocale(String locale)
void
setLocale(Locale locale)
void
setNumberPattern(String numberPattern)
void
setTextAttributes(JRAbstractTextDataSource textDataSource)
Copy the text parsing attributes for another object.void
setTextAttributes(TextDataSourceAttributes attributes)
void
setTimeZone(String timeZoneId)
void
setTimeZone(TimeZone timeZone)
-
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
-
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_CANNOT_CONVERT_FIELD_TYPE
public static final String EXCEPTION_MESSAGE_KEY_CANNOT_CONVERT_FIELD_TYPE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_CANNOT_MODIFY_PROPERTIES_AFTER_START
public static final String EXCEPTION_MESSAGE_KEY_CANNOT_MODIFY_PROPERTIES_AFTER_START
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_NODE_NOT_AVAILABLE
public static final String EXCEPTION_MESSAGE_KEY_NODE_NOT_AVAILABLE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_NULL_DOCUMENT
public static final String EXCEPTION_MESSAGE_KEY_NULL_DOCUMENT
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_NULL_SELECT_EXPRESSION
public static final String EXCEPTION_MESSAGE_KEY_NULL_SELECT_EXPRESSION
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_UNKNOWN_COLUMN_NAME
public static final String EXCEPTION_MESSAGE_KEY_UNKNOWN_COLUMN_NAME
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_UNKNOWN_NUMBER_TYPE
public static final String EXCEPTION_MESSAGE_KEY_UNKNOWN_NUMBER_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
convertNumber
protected Object convertNumber(Number number, Class<?> valueClass) throws JRException
- Throws:
JRException
-
getConvertBean
protected org.apache.commons.beanutils.locale.LocaleConvertUtilsBean getConvertBean()
-
setTextAttributes
public void setTextAttributes(JRAbstractTextDataSource textDataSource)
Copy the text parsing attributes for another object.- Parameters:
textDataSource
- the object to copy the attributes from
-
getTextAttributes
public TextDataSourceAttributes getTextAttributes()
-
setTextAttributes
public void setTextAttributes(TextDataSourceAttributes attributes)
-
getLocale
public Locale getLocale()
-
setLocale
public void setLocale(Locale locale)
-
setLocale
public void setLocale(String locale)
-
getDatePattern
public String getDatePattern()
-
setDatePattern
public void setDatePattern(String datePattern)
-
getNumberPattern
public String getNumberPattern()
-
setNumberPattern
public void setNumberPattern(String numberPattern)
-
getTimeZone
public TimeZone getTimeZone()
-
setTimeZone
public void setTimeZone(TimeZone timeZone)
-
setTimeZone
public void setTimeZone(String timeZoneId)
-
-