Module spring.data.rest.webmvc
Class JacksonMappingAwareSortTranslator
java.lang.Object
org.springframework.data.rest.webmvc.json.JacksonMappingAwareSortTranslator
Translator for
Sort arguments that is aware of Jackson-Mapping on domain classes. Jackson field names are
translated to PersistentProperty names. Domain class is looked up by resolving request URLs to mapped
repositories. Sort translation is skipped if a domain class cannot be resolved.- Since:
- 2.6
- Author:
- Mark Paluch, Oliver Gierke
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTranslatesSortorders from Jackson-mapped field names toPersistentPropertynames. -
Constructor Summary
ConstructorsConstructorDescriptionJacksonMappingAwareSortTranslator(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Repositories repositories, DomainClassResolver domainClassResolver, PersistentEntities persistentEntities, Associations associations) Creates a newJacksonMappingAwareSortTranslatorfor the givenObjectMapper,Repositories,DomainClassResolverandPersistentEntities. -
Method Summary
Modifier and TypeMethodDescriptionprotected SorttranslateSort(Sort input, MethodParameter parameter, NativeWebRequest webRequest) Translates Jackson field names within aSorttoPersistentPropertyproperty names.
-
Constructor Details
-
JacksonMappingAwareSortTranslator
public JacksonMappingAwareSortTranslator(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Repositories repositories, DomainClassResolver domainClassResolver, PersistentEntities persistentEntities, Associations associations) Creates a newJacksonMappingAwareSortTranslatorfor the givenObjectMapper,Repositories,DomainClassResolverandPersistentEntities.- Parameters:
objectMapper- must not be null.repositories- must not be null.domainClassResolver- must not be null.persistentEntities- must not be null.associations- must not be null.
-
-
Method Details
-
translateSort
Translates Jackson field names within aSorttoPersistentPropertyproperty names.
-