Skip to content

Instantly share code, notes, and snippets.

@837
Created June 12, 2016 17:52
Show Gist options
  • Save 837/169702324721b23b1a3061a3d454b977 to your computer and use it in GitHub Desktop.
Save 837/169702324721b23b1a3061a3d454b977 to your computer and use it in GitHub Desktop.
import java.lang.reflect.Type;
import com.google.gson.*;
import javafx.beans.property.SimpleStringProperty;
public class SimpleStringPropertySerializer implements JsonSerializer<SimpleStringProperty> {
public JsonElement serialize(SimpleStringProperty src, Type typeOfSrc, JsonSerializationContext context) {
return new JsonPrimitive(src.get());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment