|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jasperreports.engine.data.JRAbstractTextDataSource net.sf.jasperreports.engine.data.JsonDataSource
public class JsonDataSource
JSON data source implementation
Constructor Summary | |
---|---|
JsonDataSource(java.io.File file)
|
|
JsonDataSource(java.io.File file,
java.lang.String selectExpression)
|
|
JsonDataSource(java.io.InputStream stream)
|
|
JsonDataSource(java.io.InputStream jsonStream,
java.lang.String selectExpression)
|
|
JsonDataSource(JasperReportsContext jasperReportsContext,
java.lang.String location,
java.lang.String selectExpression)
Creates a data source instance that reads JSON data from a given location |
|
JsonDataSource(java.lang.String location,
java.lang.String selectExpression)
|
Method Summary | |
---|---|
void |
close()
|
java.lang.Object |
getFieldValue(JRField jrField)
Gets the field value for the current position. |
protected org.codehaus.jackson.JsonNode |
getJsonData(org.codehaus.jackson.JsonNode rootNode,
java.lang.String jsonExpression)
Extracts the JSON nodes based on the query expression |
protected org.codehaus.jackson.JsonNode |
goDownPath(org.codehaus.jackson.JsonNode rootNode,
java.lang.String simplePath)
Extracts the JSON nodes under the simple path |
protected org.codehaus.jackson.JsonNode |
goDownPathWithAttribute(org.codehaus.jackson.JsonNode rootNode,
java.lang.String pathWithAttributeExpression)
Extracts the JSON nodes that match the attribute expression |
protected boolean |
isValidExpression(org.codehaus.jackson.JsonNode operand,
java.lang.String attributeExpression)
Validates an attribute expression on a JsonNode |
static void |
main(java.lang.String[] args)
|
void |
moveFirst()
Moves back to the first element in the data source. |
boolean |
next()
Tries to position the cursor on the next element in the data source. |
Methods inherited from class net.sf.jasperreports.engine.data.JRAbstractTextDataSource |
---|
convertNumber, convertStringValue, getConvertBean, getDatePattern, getFormattedDate, getFormattedNumber, getLocale, getNumberPattern, getTimeZone, setDatePattern, setLocale, setLocale, setNumberPattern, setTextAttributes, setTimeZone, setTimeZone |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JsonDataSource(java.io.InputStream stream) throws JRException
JRException
public JsonDataSource(java.io.InputStream jsonStream, java.lang.String selectExpression) throws JRException
JRException
public JsonDataSource(java.io.File file) throws java.io.FileNotFoundException, JRException
java.io.FileNotFoundException
JRException
public JsonDataSource(java.io.File file, java.lang.String selectExpression) throws java.io.FileNotFoundException, JRException
java.io.FileNotFoundException
JRException
public JsonDataSource(JasperReportsContext jasperReportsContext, java.lang.String location, java.lang.String selectExpression) throws JRException
jasperReportsContext
- the JasperReportsContextlocation
- a String representing JSON data sourceselectExpression
- a String representing the select expression
JRException
public JsonDataSource(java.lang.String location, java.lang.String selectExpression) throws JRException
JRException
JsonDataSource(JasperReportsContext, String, String)
Method Detail |
---|
public void moveFirst() throws JRException
JRRewindableDataSource
moveFirst
in interface JRRewindableDataSource
JRException
public boolean next()
JRDataSource
next
in interface JRDataSource
public java.lang.Object getFieldValue(JRField jrField) throws JRException
JRDataSource
getFieldValue
in interface JRDataSource
JRException
protected org.codehaus.jackson.JsonNode getJsonData(org.codehaus.jackson.JsonNode rootNode, java.lang.String jsonExpression) throws JRException
rootNode
- jsonExpression
-
JRException
protected org.codehaus.jackson.JsonNode goDownPathWithAttribute(org.codehaus.jackson.JsonNode rootNode, java.lang.String pathWithAttributeExpression) throws JRException
rootNode
- pathWithAttributeExpression
- : e.g. Orders(CustomerId == HILAA)
JRException
protected org.codehaus.jackson.JsonNode goDownPath(org.codehaus.jackson.JsonNode rootNode, java.lang.String simplePath)
rootNode
- simplePath
- - a simple field name, with no selection by attributeprotected boolean isValidExpression(org.codehaus.jackson.JsonNode operand, java.lang.String attributeExpression) throws JRException
operand
- attributeExpression
-
JRException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |