Java 类net.sf.jasperreports.engine.data.JsonDataSource 实例源码

项目:jasperstarter    文件:DbNGTest.java   
/**
 * Test of getJsonDataSource method, of class Db.
 */
@Test
public void testGetJsonDataSource() throws Exception {
  System.out.println("getJsonDataSource");
  Config config = new Config();
  config.dbType = DsType.json;
  config.dataFile = new File("target/test-classes/contacts.json");
  config.jsonQuery = "contacts.person";
  Db instance = new Db();
  JsonDataSource jsonDataSource = instance.getJsonDataSource(config);
  assertTrue(jsonDataSource.next());
  assertEquals(jsonDataSource.getClass().getCanonicalName(), "net.sf.jasperreports.engine.data.JsonDataSource");
}
项目:jasperreports    文件:JsonQueryExecuter.java   
@Override
protected JsonDataSource getJsonDataInstance(InputStream jsonInputStream) throws JRException {
    return new JsonDataSource(jsonInputStream, getQueryString());
}
项目:jasperreports    文件:JsonQueryExecuter.java   
@Override
protected JsonDataSource getJsonDataInstance(String jsonSource) throws JRException {
    return new JsonDataSource(getJasperReportsContext(), jsonSource, getQueryString());
}
项目:jasperreports    文件:JsonQueryExecuter.java   
@Override
protected RewindableDataSourceProvider<JsonDataSource> getJsonDataProviderInstance(String source, TextDataSourceAttributes textAttributes) {
    return new JsonDataSourceProvider(getJasperReportsContext(), source, getQueryString(), textAttributes);
}