Skip to content

Instantly share code, notes, and snippets.

@837
Created June 12, 2016 17:53
Show Gist options
  • Save 837/bcdec78bb9efa6e187e076e8b895f176 to your computer and use it in GitHub Desktop.
Save 837/bcdec78bb9efa6e187e076e8b895f176 to your computer and use it in GitHub Desktop.
import java.lang.reflect.Type;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import javafx.beans.property.SimpleStringProperty;
public class SimpleStringPropertyDeserializer implements JsonDeserializer<SimpleStringProperty> {
@Override
public SimpleStringProperty deserialize(JsonElement json, Type srcType, JsonDeserializationContext context)
throws JsonParseException {
return new SimpleStringProperty(json.getAsJsonPrimitive().getAsString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment