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
ConstructorDescriptionMongoJsonSchemaMapper
(MongoConverter converter) Create a newMongoJsonSchemaMapper
facilitating the givenMongoConverter
. -
Method Summary
-
Constructor Details
-
MongoJsonSchemaMapper
Create a newMongoJsonSchemaMapper
facilitating the givenMongoConverter
.- Parameters:
converter
- must not be null.
-
-
Method Details
-
mapSchema
Description copied from interface:JsonSchemaMapper
Map the required and properties fields the givenDocument
containing 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:
mapSchema
in interfaceJsonSchemaMapper
- Parameters:
jsonSchema
- theDocument
holding the raw schema representation. Must not be null.type
- the target type to map against. Must not be null.- Returns:
- a new
Document
containing the mapped $jsonSchema never null.
-