Package it.unipd.dei.eis.data.sources
Class JsonDataSource
- java.lang.Object
-
- it.unipd.dei.eis.data.sources.DataSource<JsonDataEntity,Object>
-
- it.unipd.dei.eis.data.sources.JsonDataSource
-
public class JsonDataSource extends DataSource<JsonDataEntity,Object>
JsonDataSource is the data source for JSON records. It contains the data structure of the JSON response.
-
-
Constructor Summary
Constructors Constructor Description JsonDataSource()JsonDataSource constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<JsonDataEntity>getData(Context context)Returns the list of entities from the JSON data.voidsetData(Context context, List<JsonDataEntity> data)Sets the data to the JSON file.-
Methods inherited from class it.unipd.dei.eis.data.sources.DataSource
get, set
-
-
-
-
Field Detail
-
ID
public static final String ID
The ID of the data source.- See Also:
- Constant Field Values
-
-
Method Detail
-
getData
public List<JsonDataEntity> getData(Context context) throws Exception
Returns the list of entities from the JSON data.- Overrides:
getDatain classDataSource<JsonDataEntity,Object>- Parameters:
context- the context of the request- Returns:
- the list of articles
- Throws:
Exception- if an error occurs
-
setData
public void setData(Context context, List<JsonDataEntity> data)
Sets the data to the JSON file.- Overrides:
setDatain classDataSource<JsonDataEntity,Object>- Parameters:
context- the context of the requestdata- the list of articles
-
-