public class JsonDataSource extends AbstractDataSource
Modifier and Type | Class and Description |
---|---|
class |
JsonDataSource.JsonDataNode |
static class |
JsonDataSource.SortingComparer |
Modifier and Type | Field and Description |
---|---|
static int |
MODE_CONNECTION_STRING
constructor using mode the string is a connection string.
|
static int |
MODE_RAW_TEXT
constructor using mode the string is the JSON in the string.
|
rootNode
NAME_DATASET, NAME_JSON, NAME_LITERAL, NAME_ODATA, NAME_SFDC, NAME_SQL, NAME_XML, NAME_XML_1_0
Constructor and Description |
---|
JsonDataSource(java.io.InputStream jsonStream,
java.lang.String encoding)
Creates a Json data source from an InputStream.
|
JsonDataSource(java.lang.String jsonConnectionString,
int mode)
Create a DataSourceProvider using the passed in connection strings.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Clean up resources.
|
java.lang.String |
combineQueryForDataSet(java.lang.String dataSetQuery,
java.lang.String query,
java.lang.String dataSetName) |
java.lang.String |
getDatasourceName()
returns the name of this type in the form "sql", "xml", etc.
|
IDataSourceQueryHelper |
getQueryHelper()
Gets the query helper from the subclass.
|
int |
getQueryMode(java.lang.String select,
BaseTag tag)
Gets the query mode of a select.
|
boolean |
supportsDataSets()
Does this datasource support data sets?
|
approveDenyModifySelect, dataSourceNodeWithIndex, drillDownToVal, getParameters, getParamMode, getRootNode, getTagAttributes, populateDatasourceException, returnValue, SetDseProps, setParameters, setParamMode, validateTag
convertToInputStream, forTesting, getProperties, lookupVariable, setProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getProperties, setProperties
public static final int MODE_CONNECTION_STRING
public static final int MODE_RAW_TEXT
public JsonDataSource(java.lang.String jsonConnectionString, int mode) throws DataConnectionException
jsonConnectionString
- Connection string to read the XML file. Or if mode is raw text, the actual JSON.mode
- One of the MODE_CONNECTION_* valuesDataConnectionException
public JsonDataSource(java.io.InputStream jsonStream, java.lang.String encoding) throws DataConnectionException
jsonStream
- - Stream to create the data source from.encoding
- - character encoding of the fileDataConnectionException
public java.lang.String getDatasourceName()
public IDataSourceQueryHelper getQueryHelper()
getQueryHelper
in class AbstractDataSource
public void close() throws DataSourceException
AbstractDataSource
close
in interface DataSourceProvider
close
in class AbstractDataSource
DataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public int getQueryMode(java.lang.String select, BaseTag tag)
AbstractDataSource
getQueryMode
in interface DataSourceProvider
getQueryMode
in class AbstractDataSource
select
- The query we need to return the mode fortag
- The tag this select is for. This may be null.public boolean supportsDataSets()
supportsDataSets
in class DataSourceBase
public java.lang.String combineQueryForDataSet(java.lang.String dataSetQuery, java.lang.String query, java.lang.String dataSetName)
combineQueryForDataSet
in class AbstractDataSource
Copyright © 2002-2021 Windward Studios, LLC. - All Rights Reserved. We are Java document generation software