Class Jackson2HalModule.EmbeddedMapper
java.lang.Object
org.springframework.hateoas.mediatype.hal.Jackson2HalModule.EmbeddedMapper
- Enclosing class:
- Jackson2HalModule
Helper to easily map embedded resources and find out whether they were curied.
- Author:
- Oliver Gierke
-
Constructor Summary
ConstructorDescriptionEmbeddedMapper
(LinkRelationProvider relProvider, CurieProvider curieProvider, boolean preferCollectionRels) -
Method Summary
Modifier and TypeMethodDescriptionboolean
hasCuriedEmbed
(Iterable<?> source) Returns whether the given source elements will be namespaced.Maps the given source elements as embedded values.map
(LinkRelation source) Maps the givenHalLinkRelation
using the underlying relation transformer.with
(com.fasterxml.jackson.databind.PropertyNamingStrategy strategy) Registers the givenPropertyNamingStrategy
with the current mapper to forward that strategy as relation transformer, so thatLinkRelation
s used as key for the embedding will be transformed using the given strategy.
-
Constructor Details
-
EmbeddedMapper
public EmbeddedMapper(LinkRelationProvider relProvider, CurieProvider curieProvider, boolean preferCollectionRels)
-
-
Method Details
-
with
public Jackson2HalModule.EmbeddedMapper with(@Nullable com.fasterxml.jackson.databind.PropertyNamingStrategy strategy) Registers the givenPropertyNamingStrategy
with the current mapper to forward that strategy as relation transformer, so thatLinkRelation
s used as key for the embedding will be transformed using the given strategy.- Parameters:
strategy
- must not be null.- Returns:
- an
Jackson2HalModule.EmbeddedMapper
applying the given strategy when mapping embedded objects.
-
map
Maps the given source elements as embedded values.- Parameters:
source
- must not be null.- Returns:
-
map
Maps the givenHalLinkRelation
using the underlying relation transformer.- Parameters:
source
- must not be null.- Returns:
-
hasCuriedEmbed
Returns whether the given source elements will be namespaced.- Parameters:
source
- must not be null.- Returns:
-