JsonDataSource

Inheritance: java.lang.Object

public class JsonDataSource

Provides access to data of a JSON file or stream to be used within a report.

To learn more, visit the LINQ Reporting Engine documentation article.

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 ReportingEngine. buildReport overloads.

In template documents, if a top-level JSON element is an array, a JsonDataSource instance should be treated in the same way as if it was a DataTable instance. If a top-level JSON element is an object, a JsonDataSource instance should be treated in the same way as if it was a DataRow instance. For more information, see template syntax reference(https://docs.aspose.com/display/wordsjava/Template+Syntax).

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 JsonDataLoadOptions instance to a constructor of this class.

Constructors

Constructor Description
JsonDataSource(String jsonPath) Creates a new data source with data from a JSON file using default options for parsing JSON data.
JsonDataSource(InputStream jsonStream) Initializes a new instance of this class.
JsonDataSource(String jsonPath, JsonDataLoadOptions options) Creates a new data source with data from a JSON file using the specified options for parsing JSON data.
JsonDataSource(InputStream jsonStream, JsonDataLoadOptions options) Initializes a new instance of this class.

Methods

Method Description
equals(Object arg0)
getClass()
hashCode()
notify()
notifyAll()
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

JsonDataSource(String jsonPath)

public JsonDataSource(String jsonPath)

Creates a new data source with data from a JSON file using default options for parsing JSON data.

Parameters:

Parameter Type Description
jsonPath java.lang.String The path to the JSON file to be used as the data source.

JsonDataSource(InputStream jsonStream)

public JsonDataSource(InputStream jsonStream)

Initializes a new instance of this class.

Parameters:

Parameter Type Description
jsonStream java.io.InputStream

JsonDataSource(String jsonPath, JsonDataLoadOptions options)

public JsonDataSource(String jsonPath, JsonDataLoadOptions options)

Creates a new data source with data from a JSON file using the specified options for parsing JSON data.

Parameters:

Parameter Type Description
jsonPath java.lang.String The path to the JSON file to be used as the data source.
options JsonDataLoadOptions Options for parsing JSON data.

JsonDataSource(InputStream jsonStream, JsonDataLoadOptions options)

public JsonDataSource(InputStream jsonStream, JsonDataLoadOptions options)

Initializes a new instance of this class.

Parameters:

Parameter Type Description
jsonStream java.io.InputStream
options JsonDataLoadOptions

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

Parameter Type Description
arg0 java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

Parameter Type Description
arg0 long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

Parameter Type Description
arg0 long
arg1 int