ReportMill 12 API

com.reportmill.datasource
Class RMJSONDataSource

java.lang.Object
  extended by com.reportmill.base.RMObject
      extended by com.reportmill.datasource.RMDataSource
          extended by com.reportmill.datasource.RMFileDataSource
              extended by com.reportmill.datasource.RMJSONDataSource
All Implemented Interfaces:
com.reportmill.base.RMPropertyChanger, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener

public class RMJSONDataSource
extends RMFileDataSource

A data source for JSON read from parameterized URLs.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.reportmill.datasource.RMDataSource
RMDataSource.EntityResolver
 
Constructor Summary
RMJSONDataSource()
          Creates a new JSON datasource.
RMJSONDataSource(java.lang.Object aSource)
          Creates a new JSON datasource for source.
 
Method Summary
 java.util.List convertJSON(com.reportmill.archiver.JSONArray anArray)
          Converts a JSON array to List.
 java.util.Map convertJSON(com.reportmill.archiver.JSONObject anObj)
          Converts a JSON object to Map.
 java.util.Map getDataset()
          Returns all data source data as a dataset.
 java.util.List<RMRow> getEntityRows(RMEntity anEntity)
          Returns the list of rows for a given entity.
 java.lang.Object getSource()
          Returns the datasource source.
 java.lang.String getTypeString()
          Returns the type string.
 RMSchema readSchema()
          Reads the schema from json file.
 void setSource(java.lang.Object aSource)
          Sets the datasource source.
 
Methods inherited from class com.reportmill.datasource.RMFileDataSource
createEntityImpl, delete, deleteFileImpl, deleteRowImpl, fromXML, getEntityFile, getFilesImpl, getPath, getRowsImpl, getSchema, insertRowImpl, readFileImpl, saveRowsImmediately, saveSchema, setPath, toXML, updateRowImpl, writeFileImpl
 
Methods inherited from class com.reportmill.datasource.RMDataSource
create, createEntity, createObject, deleteEntity, deleteFile, deleteRow, equals, getAllRows, getDataset, getEntity, getEntityClass, getEntityResolver, getFile, getFile, getFile, getName, getRootDirectory, getRow, getRow, getRows, getSchemaVisible, getUniqueRow, insertRow, propertyChange, readFile, refresh, saveRows, setEntityResolver, setName, toString, updateRow, writeFile
 
Methods inherited from class com.reportmill.base.RMObject
addListener, addPropertyChangeListener, animUpdate, clone, firePropertyChange, firePropertyChange, getListener, getListenerCount, getListeners, isFirePropertyChangeEnabled, isUndoing, removeListener, removePropertyChangeListener, setFirePropertyChangeEnabled, setUndoing
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RMJSONDataSource

public RMJSONDataSource()
Creates a new JSON datasource.


RMJSONDataSource

public RMJSONDataSource(java.lang.Object aSource)
Creates a new JSON datasource for source.

Method Detail

getTypeString

public java.lang.String getTypeString()
Returns the type string.

Overrides:
getTypeString in class RMFileDataSource

getSource

public java.lang.Object getSource()
Returns the datasource source.


setSource

public void setSource(java.lang.Object aSource)
Sets the datasource source.


getDataset

public java.util.Map getDataset()
Returns all data source data as a dataset.

Overrides:
getDataset in class RMFileDataSource

readSchema

public RMSchema readSchema()
Reads the schema from json file.

Overrides:
readSchema in class RMFileDataSource

getEntityRows

public java.util.List<RMRow> getEntityRows(RMEntity anEntity)
Description copied from class: RMFileDataSource
Returns the list of rows for a given entity.

Overrides:
getEntityRows in class RMFileDataSource

convertJSON

public java.util.Map convertJSON(com.reportmill.archiver.JSONObject anObj)
Converts a JSON object to Map.


convertJSON

public java.util.List convertJSON(com.reportmill.archiver.JSONArray anArray)
Converts a JSON array to List.


ReportMill 12 API