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
ConstructorsConstructorDescriptionEmbeddedMapper(LinkRelationProvider relProvider, CurieProvider curieProvider, boolean preferCollectionRels) -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasCuriedEmbed(Iterable<?> source) Returns whether the given source elements will be namespaced.Maps the given source elements as embedded values.map(LinkRelation source) Maps the givenHalLinkRelationusing the underlying relation transformer.with(com.fasterxml.jackson.databind.PropertyNamingStrategy strategy) Registers the givenPropertyNamingStrategywith the current mapper to forward that strategy as relation transformer, so thatLinkRelations 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 givenPropertyNamingStrategywith the current mapper to forward that strategy as relation transformer, so thatLinkRelations used as key for the embedding will be transformed using the given strategy.- Parameters:
strategy- must not be null.- Returns:
- an
Jackson2HalModule.EmbeddedMapperapplying 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 givenHalLinkRelationusing 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:
-