Class DataPointParser

java.lang.Object
com.framed.io.dispatch.DataPointParser

public class DataPointParser extends Object
Utility for converting a JSON bus message into a DataPoint.
  • Method Details

    • parse

      public static DataPoint<?> parse(org.json.JSONObject jsonObject) throws Exception
      Converts a JSON bus message into a DataPoint.

      The timestamp is parsed using Timer.formatter and interpreted as UTC.

      Parameters:
      jsonObject - the JSON object carrying value, timestamp, channelID, deviceID and className
      Returns:
      the datapoint decoded from the given JSON object
      Throws:
      Exception - if a required field is missing or the timestamp cannot be parsed