I have a simple soothing service that I am developing in java. I considered several options for sorting / untying json. Possible approaches available by jaxb jackson, etc., are completely new to me, and I'm trying to find legs with them. I was wondering if I could get some advice on what would be the best approach and technology to use, especially considering that many of the objects that interest me, I implemented as immutable, and I used the builder pattern. Thus, there are no setters, and the constructor is private.
I reviewed this previous question: Jackson + Builder Pattern? hosted on stackoverflow. I am considering something like this approach, although it would be nice to get some pointers to additional resources about using @JsonDeserialize
Here is a very simple example of the type of object I am considering
public class Reading { private final double xCoord; private final double yCoord; private final double diameter; private final double reliability; private final String qualityCode; private Reading(Builder builder){ xCoord = builder.xCoord; yCoord = builder.yCoord; diameter = builder.diameter; reliability = builder.reliability; qualityCode = builder.qualityCode; } public static class Builder {
}
There is no problem sorting this object, but unmarshalling does not seem straightforward. Is there also support to exclude entries for values ββof objects that are null?
java jackson jersey jaxb
Conor
source share