A Jackson module for handling HAL
This requires registering two modules in the ObjectMapper
:
objectMapper.registerModule(new HalModule());
objectMapper.registerModule(new UriTemplateModule());
Serialization and deserialization are based on the HalResource
class:
HalResource resource = objectMapper.readValue(halJsonString, HalResource.class);
HalRel nextRel = resource.getRel("next");
HalLink nextLink = nextRel.getSingleLink();
List<HalLink> itemLinks = resource.getRel("items")
.getMultipleLinks();