Module spring.data.mongodb
Class MongoJsonSchemaMapper
java.lang.Object
org.springframework.data.mongodb.core.convert.MongoJsonSchemaMapper
- All Implemented Interfaces:
JsonSchemaMapper
JsonSchemaMapper implementation using the conversion and mapping infrastructure for mapping fields to the
provided domain type.- Since:
- 2.1
- Author:
- Christoph Strobl, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionMongoJsonSchemaMapper(MongoConverter converter) Create a newMongoJsonSchemaMapperfacilitating the givenMongoConverter. -
Method Summary
-
Constructor Details
-
MongoJsonSchemaMapper
Create a newMongoJsonSchemaMapperfacilitating the givenMongoConverter.- Parameters:
converter- must not be null.
-
-
Method Details
-
mapSchema
Description copied from interface:JsonSchemaMapperMap the required and properties fields the givenDocumentcontaining the $jsonSchema against the given domain type.
The source document remains untouched, fields that do not require mapping are simply copied over to the mapped instance.- Specified by:
mapSchemain interfaceJsonSchemaMapper- Parameters:
jsonSchema- theDocumentholding the raw schema representation. Must not be null.type- the target type to map against. Must not be null.- Returns:
- a new
Documentcontaining the mapped $jsonSchema never null.
-