Class JsonReader
- java.lang.Object
-
- com.smartgridready.communicator.common.helper.JsonBase
-
- com.smartgridready.communicator.common.helper.JsonReader
-
public class JsonReader extends JsonBase
Maps a received JSON value into the required SmartGridready JSON output value. The timestamps are converted to a canonical format first and afterwards.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJsonReader.KeyImplements a map key.
-
Field Summary
-
Fields inherited from class com.smartgridready.communicator.common.helper.JsonBase
keywordMapInput, objectMapper
-
-
Constructor Summary
Constructors Constructor Description JsonReader(java.util.Map<java.lang.String,java.lang.String> keywordMapInput)Constructs a new instance.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<JsonReader.Key,java.util.Map<java.lang.String,java.lang.Object>>mapToFlatList(java.lang.String jsonFile, java.util.Map<java.lang.String,java.lang.String> keywordMap)Converts a JSON string to a data structure of key-value pairs, using a keyword map.
-
-
-
Method Detail
-
mapToFlatList
public static java.util.Map<JsonReader.Key,java.util.Map<java.lang.String,java.lang.Object>> mapToFlatList(java.lang.String jsonFile, java.util.Map<java.lang.String,java.lang.String> keywordMap) throws com.fasterxml.jackson.core.JsonProcessingException
Converts a JSON string to a data structure of key-value pairs, using a keyword map.- Parameters:
jsonFile- the JSON inputkeywordMap- the keyword map- Returns:
- a map of key-value pairs
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if parsing failed
-
-