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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final StringProperty 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
ConstructorsModifierConstructorDescriptionprotectedJsonQLDataSource(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
Modifier and TypeMethodDescriptionintprotected ObjectgetConvertedValue(JRJsonNode node, JRField jrField) protected StringgetFieldExpression(JRField field) getFieldValue(JRField jrField) Gets the field value for the current position.voidMoves back to the first element in the data source.voidmoveToRecord(int index) booleannext()Tries to position the cursor on the next element in the data source.intsubDataSource(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 Details
-
EXCEPTION_MESSAGE_KEY_NO_DATA
- See Also:
-
EXCEPTION_MESSAGE_KEY_JSON_FIELD_VALUE_NOT_RETRIEVED
- See Also:
-
PROPERTY_FIELD_EXPRESSION
Property specifying the JSONQL expression for the dataset field.- See Also:
-
-
Constructor Details
-
JsonQLDataSource
- Throws:
JRException
-
JsonQLDataSource
- Throws:
JRException
-
JsonQLDataSource
- Throws:
JRException
-
JsonQLDataSource
- 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
- Throws:
JRException
-
-
Method Details
-
moveFirst
Description copied from interface:JRRewindableDataSourceMoves back to the first element in the data source.- Specified by:
moveFirstin interfaceJRRewindableDataSource- Throws:
JRException
-
next
Description copied from interface:JRDataSourceTries to position the cursor on the next element in the data source.- Specified by:
nextin interfaceJRDataSource- Returns:
- true if there is a next record, false otherwise
- Throws:
JRException- if any error occurs while trying to move to the next element
-
recordCount
public int recordCount()- Specified by:
recordCountin interfaceRandomAccessDataSource
-
currentIndex
public int currentIndex()- Specified by:
currentIndexin interfaceRandomAccessDataSource
-
moveToRecord
- Specified by:
moveToRecordin interfaceRandomAccessDataSource- Throws:
NoRecordAtIndexException
-
getFieldValue
Description copied from interface:JRDataSourceGets the field value for the current position.- Specified by:
getFieldValuein interfaceJRDataSource- Returns:
- an object containing the field value. The object type must be the field object type.
- Throws:
JRException
-
subDataSource
- Specified by:
subDataSourcein interfaceHierarchicalDataSource<JsonQLDataSource>- Throws:
JRException
-
subDataSource
- Specified by:
subDataSourcein interfaceHierarchicalDataSource<JsonQLDataSource>- Throws:
JRException
-
getConvertedValue
- Throws:
JRException
-
getFieldExpression
-