Package net.sf.jasperreports.json.data
Class JsonQLDataSource
- java.lang.Object
-
- net.sf.jasperreports.engine.data.JRAbstractTextDataSource
-
- net.sf.jasperreports.json.data.JsonQLDataSource
-
- All Implemented Interfaces:
HierarchicalDataSource<JsonQLDataSource>,JsonData<JsonQLDataSource>,RandomAccessDataSource,JRDataSource,JRRewindableDataSource
public class JsonQLDataSource extends JRAbstractTextDataSource implements JsonData<JsonQLDataSource>, RandomAccessDataSource
- Author:
- Narcis Marcu (narcism@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXCEPTION_MESSAGE_KEY_JSON_FIELD_VALUE_NOT_RETRIEVEDstatic StringEXCEPTION_MESSAGE_KEY_NO_DATAstatic StringPROPERTY_FIELD_EXPRESSIONProperty specifying the JSONQL expression for the dataset field.-
Fields inherited from class net.sf.jasperreports.engine.data.JRAbstractTextDataSource
EXCEPTION_MESSAGE_KEY_CANNOT_CONVERT_FIELD_TYPE, EXCEPTION_MESSAGE_KEY_CANNOT_MODIFY_PROPERTIES_AFTER_START, EXCEPTION_MESSAGE_KEY_NODE_NOT_AVAILABLE, EXCEPTION_MESSAGE_KEY_NULL_DOCUMENT, EXCEPTION_MESSAGE_KEY_NULL_SELECT_EXPRESSION, EXCEPTION_MESSAGE_KEY_UNKNOWN_COLUMN_NAME, EXCEPTION_MESSAGE_KEY_UNKNOWN_NUMBER_TYPE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedJsonQLDataSource(com.fasterxml.jackson.databind.JsonNode jacksonJsonTree, String selectExpression)JsonQLDataSource(File file)JsonQLDataSource(File file, String selectExpression)JsonQLDataSource(InputStream jsonInputStream)JsonQLDataSource(InputStream jsonInputStream, String selectExpression)JsonQLDataSource(JasperReportsContext jasperReportsContext, String jsonSource, String selectExpression)protectedJsonQLDataSource(JRJsonNode root, String selectExpression)JsonQLDataSource(RepositoryContext repositoryContext, String jsonSource, String selectExpression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcurrentIndex()protected ObjectgetConvertedValue(JRJsonNode node, JRField jrField)protected StringgetFieldExpression(JRField field)ObjectgetFieldValue(JRField jrField)voidmoveFirst()voidmoveToRecord(int index)booleannext()intrecordCount()JsonQLDataSourcesubDataSource()JsonQLDataSourcesubDataSource(String selectExpression)-
Methods inherited from class net.sf.jasperreports.engine.data.JRAbstractTextDataSource
convertNumber, convertStringValue, getConvertBean, getDatePattern, getLocale, getNumberPattern, getTextAttributes, getTimeZone, setDatePattern, setLocale, setLocale, setNumberPattern, setTextAttributes, setTextAttributes, setTimeZone, setTimeZone
-
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_NO_DATA
public static final String EXCEPTION_MESSAGE_KEY_NO_DATA
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_JSON_FIELD_VALUE_NOT_RETRIEVED
public static final String EXCEPTION_MESSAGE_KEY_JSON_FIELD_VALUE_NOT_RETRIEVED
- See Also:
- Constant Field Values
-
PROPERTY_FIELD_EXPRESSION
public static final String PROPERTY_FIELD_EXPRESSION
Property specifying the JSONQL expression for the dataset field.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JsonQLDataSource
public JsonQLDataSource(File file, String selectExpression) throws JRException
- Throws:
JRException
-
JsonQLDataSource
public JsonQLDataSource(File file) throws JRException
- Throws:
JRException
-
JsonQLDataSource
public JsonQLDataSource(InputStream jsonInputStream, String selectExpression) throws JRException
- Throws:
JRException
-
JsonQLDataSource
public JsonQLDataSource(InputStream jsonInputStream) throws JRException
- Throws:
JRException
-
JsonQLDataSource
public JsonQLDataSource(JasperReportsContext jasperReportsContext, String jsonSource, String selectExpression) throws JRException
- Throws:
JRException
-
JsonQLDataSource
public JsonQLDataSource(RepositoryContext repositoryContext, String jsonSource, String selectExpression) throws JRException
- Throws:
JRException
-
JsonQLDataSource
protected JsonQLDataSource(com.fasterxml.jackson.databind.JsonNode jacksonJsonTree, String selectExpression) throws JRException- Throws:
JRException
-
JsonQLDataSource
protected JsonQLDataSource(JRJsonNode root, String selectExpression) throws JRException
- Throws:
JRException
-
-
Method Detail
-
moveFirst
public void moveFirst() throws JRException- Specified by:
moveFirstin interfaceJRRewindableDataSource- Throws:
JRException
-
next
public boolean next() throws JRException- Specified by:
nextin interfaceJRDataSource- Throws:
JRException
-
recordCount
public int recordCount()
- Specified by:
recordCountin interfaceRandomAccessDataSource
-
currentIndex
public int currentIndex()
- Specified by:
currentIndexin interfaceRandomAccessDataSource
-
moveToRecord
public void moveToRecord(int index) throws NoRecordAtIndexException- Specified by:
moveToRecordin interfaceRandomAccessDataSource- Throws:
NoRecordAtIndexException
-
getFieldValue
public Object getFieldValue(JRField jrField) throws JRException
- Specified by:
getFieldValuein interfaceJRDataSource- Throws:
JRException
-
subDataSource
public JsonQLDataSource subDataSource() throws JRException
- Specified by:
subDataSourcein interfaceHierarchicalDataSource<JsonQLDataSource>- Throws:
JRException
-
subDataSource
public JsonQLDataSource subDataSource(String selectExpression) throws JRException
- Specified by:
subDataSourcein interfaceHierarchicalDataSource<JsonQLDataSource>- Throws:
JRException
-
getConvertedValue
protected Object getConvertedValue(JRJsonNode node, JRField jrField) throws JRException
- Throws:
JRException
-
-