JSON in Java the Right Way -- Action, Jackson!
Tags: JacksonJaxbJsonProvider, jaxrs
Permalink Reply by Tatu Saloranta on April 12, 2010 at 10:54pm
Permalink Reply by Ray Toal on April 12, 2010 at 11:20pm @XmlRootElement(name = "job_run")
public class JobRunDto implements Transportable {
@XmlElement(nillable = true)
private UUID id;
@XmlJavaTypeAdapter(value = DateTimeXmlAdapter.class)
@XmlElement(name = "start_time")
private DateTime startTime;
@XmlJavaTypeAdapter(value = DateTimeXmlAdapter.class)
@XmlElement(name = "end_time", nillable = true)
private DateTime endTime;
@XmlElement(nillable = true)
private JobRunStatus status;
@XmlElement(name = "last_checkpoint_time", nillable = true)
private DateTime lastCheckpointTime;
@XmlElement(nillable = true)
private String hostname;
@XmlElement(name = "instance_name", nillable = true)
private String instanceName;
// ... MORE PROPERTIES ...
/** Required constructor for JAXB. */
private JobRunDto() {
// empty constructor for JAXB
}
// ... GETTERS ...
// ... NO SETTERS, BUT THERE IS A BUILDER ...
}
Properties should only be output once, so this is not working as intended. Can you share bit more of the value class definition? Maybe that could suggest what might be going wrong.
I am not familiar with how CXF uses Jackson, but I assume they implement JAX-RS API the usual way.
Permalink Reply by Ray Toal on April 12, 2010 at 11:24pm
Permalink Reply by Ray Toal on April 13, 2010 at 12:25pm
Permalink Reply by Tatu Saloranta on April 13, 2010 at 3:52pm
© 2013 Created by Tatu Saloranta.
Powered by