I am trying to deserialise the Color class from JSON with Jackson but it throws exception:
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "colorSpace" (class java.awt.Color), not marked as ignorable.
What i'm doing wrong? This is my code:
File act = new File(new File().getAbsolutePath());
ObjectMapper om = new ObjectMapper();
File f = new File(act, "123.JSON");
om.writeValue(f, new person());
person per = om.readValue(f, person.class);
System.out.println(per);
This is my person class:
public class person implements Serializable {
//it include getters, setters and builder
String nombe = "Pepe";
String CI = "12345678978";
Color c = Color.red;
}