Package org.openhab.core.config.core
Class ConfigurationDeserializer
java.lang.Object
org.openhab.core.config.core.ConfigurationDeserializer
- All Implemented Interfaces:
com.google.gson.JsonDeserializer<Configuration>
public class ConfigurationDeserializer
extends Object
implements com.google.gson.JsonDeserializer<Configuration>
Deserializes a
Configuration
object.
As opposed to Gson's default behavior, it ensures that all numbers are represented as BigDecimal
s.- Author:
- Simon Kaufmann - Initial contribution, Ana Dimova - added a deserializer for the configuration, conforming to the automation json format
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context)
-
Constructor Details
-
ConfigurationDeserializer
public ConfigurationDeserializer()
-
-
Method Details
-
deserialize
public Configuration deserialize(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException - Specified by:
deserialize
in interfacecom.google.gson.JsonDeserializer<Configuration>
- Throws:
com.google.gson.JsonParseException
-