Commit Graph

2 Commits

Author SHA1 Message Date
Oliver Gierke
137e7c390f #128 - Severe refactoring regarding LinkDiscoverers.
The LinkDiscoverer interface is now a Plugin<MediaType> to allow selecting a discoverer per media type. We also provide a LinkDiscoverers wrapper around a PluginRegistry for easier injection.

Dropped DefaultLinkDiscoverer as the above mentioned changed prohibits the usage of a discoverer without a media type. Clients that previously used DefaultLinkDiscoverer should switch to JsonPathLinkDiscoverer with a custom JsonPath expression and media type.

@EnableHypermediaSupport now supports multiple HypermediaType values set to be able to set up support for multiple hypermedia formats. Admittedly, the only currently supported type is HAL but we prepare for the addition of other (e.g. Collection/JSON or the like). We changed the infrastructure setup taken care of by @EnableHypermediaSupport to not enrich all ObjectMapper instances with our HAL modules but explicitly register an ObjectMapper with the application context and then registering a custom MappingJackson(2)HttpMessageConverter with the HandlerAdapter instances present in the ApplicationContext. We skip the registration if an already registered MJ2HMC has an ObjectMapper already supporting the Spring HATEOAS mixins.

Removed some compiler warnings.
2013-12-19 13:01:35 +01:00
Oliver Gierke
0e0bf16957 #31 - Introduced LinkDiscoverer to extract Link instances from representations.
LinkDiscoverer exposes an API to find Links by their relation types in representations. Added JSONPath based base class and a DefaultLinkDiscoverer that finds Links based on the default rendering of our Jackson mappings.
2012-12-15 19:07:03 +01:00