UriTemplate class to
better integrate with the Jackson JSON framework.See: Description
| Class | Description |
|---|---|
| UriTemplateDeserializer |
A
JsonDeserializer that deserializes a string into a UriTemplate. |
| UriTemplateModule |
Uri Template module for Jackson.
|
| UriTemplateSerializer |
A
JsonSerializer that serializes a UriTemplate to a JSON string value. |
These classes allow the UriTemplate class to
better integrate with the Jackson JSON framework. This will enable JSON properties
to map directly to a UriTemplate. This can be
done by one of two ways:
Via Object Mapper:
ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(new UriTemplateModule());
Or via annotations on the desired property:
@JsonDeserialize(using = UriTemplateDeserializer.class) @JsonSerialize(using = UriTemplateSerializer.class) private UriTemplate template; ...
Both options will yield the same results, but the module registration is far more convenient.
Copyright © 2012-04-30–2016 Ryan J. McDonough. All rights reserved.