Package com.basiscomponents.db.util
Class DataRowJsonMapper
- java.lang.Object
-
- com.basiscomponents.db.util.DataRowJsonMapper
-
public class DataRowJsonMapper extends Object
-
-
Constructor Summary
Constructors Constructor Description DataRowJsonMapper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DataRowfromJson(String in)Initializes and returns a DataRow object based on the values provided in the given JSON String.static DataRowfromJson(String in, DataRow meta)Initializes and returns a DataRow object based on the values provided in the given JSON String.static DataRowmetaDataFromJson(String js)Parses and returns a DataRow object that contains meta data
-
-
-
Method Detail
-
fromJson
public static DataRow fromJson(String in) throws IOException, ParseException, com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException
Initializes and returns a DataRow object based on the values provided in the given JSON String.- Parameters:
in- The JSON String- Returns:
- the DataRow object created based on the JSOn String's content
- Throws:
IOExceptionParseExceptioncom.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionException- Gets thrown in case the JSON could not be parsed / is invalid
-
fromJson
public static DataRow fromJson(String in, DataRow meta) throws IOException, ParseException, com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException
Initializes and returns a DataRow object based on the values provided in the given JSON String.- Parameters:
in- The JSON Stringmeta- A DataRow that will be used to determine the field types if not given in the meta section of the JSON String- Returns:
- the DataRow object created based on the JSOn String's content
- Throws:
IOExceptionParseExceptioncom.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionException- Gets thrown in case the JSON could not be parsed / is invalid
-
metaDataFromJson
public static DataRow metaDataFromJson(String js) throws IOException, ParseException
Parses and returns a DataRow object that contains meta data- Parameters:
in- The JSON String of the first row- Returns:
- the DataRow object containing meta data created by parsing the first row
- Throws:
ParseExceptionIOException
-
-