コード例 #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));
        }
コード例 #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;
 }
コード例 #3
0
 private AvroSchema(ISchemaReader <T> reader, ISchemaWriter <T> writer, ISchemaInfo schemaInfo) : base(schemaInfo)
 {
     Reader = reader;
     Writer = writer;
 }
コード例 #4
0
 private JSONSchema(ISchemaInfo SchemaInfo, Type pojo, ISchemaReader <T> reader, ISchemaWriter <T> writer) : base(SchemaInfo)
 {
     _pojo  = pojo;
     Writer = writer;
     Reader = reader;
 }
コード例 #5
0
 public ISchemaDefinitionBuilder <T> WithSchemaWriter(ISchemaWriter <T> writer)
 {
     _writer = writer;
     return(this);
 }