Exemplo n.º 1
0
        public static JSONSchema <T> Of(ISchemaDefinition <T> schemaDefinition)
        {
            ISchemaReader <T> Reader = schemaDefinition.SchemaReaderOpt.GetOrElse(new JsonReader <T>(_jsonMapper));
            ISchemaWriter <T> Writer = schemaDefinition.SchemaWriterOpt.GetOrElse(new JsonWriter <T>(_jsonMapper));

            return(new JSONSchema <T>(SchemaUtils.ParseSchemaInfo(schemaDefinition, SchemaType.JSON), schemaDefinition.Pojo, Reader, Writer));
        }
Exemplo n.º 2
0
 public SchemaDefinitionImpl(Type pojo, string jsonDef, bool alwaysAllowNull, IDictionary <string, string> properties, bool supportSchemaVersioning, bool jsr310ConversionEnabled, ISchemaReader <T> reader, ISchemaWriter <T> writer)
 {
     _alwaysAllowNull         = alwaysAllowNull;
     _properties              = properties;
     _jsonDef                 = jsonDef;
     _pojo                    = pojo;
     _supportSchemaVersioning = supportSchemaVersioning;
     _jsr310ConversionEnabled = jsr310ConversionEnabled;
     _reader                  = reader;
     _writer                  = writer;
 }
Exemplo n.º 3
0
 private AvroSchema(ISchemaReader <T> reader, ISchemaWriter <T> writer, ISchemaInfo schemaInfo) : base(schemaInfo)
 {
     Reader = reader;
     Writer = writer;
 }
Exemplo n.º 4
0
 private JSONSchema(ISchemaInfo SchemaInfo, Type pojo, ISchemaReader <T> reader, ISchemaWriter <T> writer) : base(SchemaInfo)
 {
     _pojo  = pojo;
     Writer = writer;
     Reader = reader;
 }
 public ISchemaDefinitionBuilder <T> WithSchemaWriter(ISchemaWriter <T> writer)
 {
     _writer = writer;
     return(this);
 }