Interface JsonSchemaMapper

All Known Implementing Classes:
MongoJsonSchemaMapper

public interface JsonSchemaMapper
JsonSchemaMapper allows mapping a given Document containing a $jsonSchema to the fields of a given domain type. The mapping considers Field annotations and other Spring Data specifics.
Since:
2.1
Author:
Christoph Strobl
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bson.Document
    mapSchema(org.bson.Document jsonSchema, Class<?> type)
    Map the required and properties fields the given Document containing the $jsonSchema against the given domain type.
  • Method Details

    • mapSchema

      org.bson.Document mapSchema(org.bson.Document jsonSchema, Class<?> type)
      Map the required and properties fields the given Document 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.
      Parameters:
      jsonSchema - the Document 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.