Package com.damnhandy.uri.template.jackson.datatype
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.
- Version:
- $Revision: 1.1 $
- Author:
- Ryan J. McDonough
-
Class Summary Class Description UriTemplateDeserializer AJsonDeserializer
that deserializes a string into aUriTemplate
.UriTemplateModule Uri Template module for Jackson.UriTemplateSerializer AJsonSerializer
that serializes aUriTemplate
to a JSON string value.