How can I map a simple JSON object {\"status\" : \"successful\"} automaticly map to my Java Enum within JAX-RS?
{\"status\" : \"successful\"}
public enum Status { SUCESSFUL
The following JAXB annotations should do it. (I tested using Jettison but I've not tried other providers):
JAXB
Jettison
@XmlType(name = "status") @XmlEnum public enum Status { @XmlEnumValue(value = "successful") SUCESSFUL, @XmlEnumValue(value = "error") ERROR; }