Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 616 Bytes

README.md

File metadata and controls

26 lines (17 loc) · 616 Bytes

jackson-datatype-hal

A Jackson module for handling HAL

Configuration

This requires registering two modules in the ObjectMapper:

objectMapper.registerModule(new HalModule());
objectMapper.registerModule(new UriTemplateModule());

Usage

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();