public class JsonDataSource
To access data of the corresponding file or stream while generating a report, pass an instance of this class as
a data source to one of
In template documents, if a top-level JSON element is an array, a
In template documents, you can work with typed values of JSON elements. For convenience, the engine replaces the set
of JSON simple types with the following one:
The engine automatically recognizes values of the extra types upon their JSON representations.
To override default behavior of JSON data loading, initialize and pass a
Constructor Summary |
---|
JsonDataSource(java.lang.StringjsonPath)
Creates a new data source with data from a JSON file using default options for parsing JSON data. |
JsonDataSource(java.io.InputStreamjsonStream)
Creates a new data source with data from a JSON stream using default options for parsing JSON data. |
JsonDataSource(java.lang.StringjsonPath, JsonDataLoadOptions options)
Creates a new data source with data from a JSON file using the specified options for parsing JSON data. |
JsonDataSource(java.io.InputStreamjsonStream, JsonDataLoadOptions options)
Creates a new data source with data from a JSON stream using the specified options for parsing JSON data. |
public JsonDataSource(java.lang.String jsonPath) throws java.lang.Exception
jsonPath
- The path to the JSON file to be used as the data source.public JsonDataSource(java.io.InputStream jsonStream) throws java.lang.Exception
jsonStream
- The stream of JSON data to be used as the data source.public JsonDataSource(java.lang.String jsonPath, JsonDataLoadOptions options) throws java.lang.Exception
jsonPath
- The path to the JSON file to be used as the data source.options
- Options for parsing JSON data.public JsonDataSource(java.io.InputStream jsonStream, JsonDataLoadOptions options) throws java.lang.Exception
jsonStream
- The stream of JSON data to be used as the data source.options
- Options for parsing JSON data.