/// <summary> /// Static function to return new instance of the fixed schema class /// </summary> /// <param name="jtok">JSON object for the fixed schema</param> /// <param name="names">list of named schema already parsed in</param> /// <param name="encspace">enclosing namespace of the fixed schema</param> /// <returns></returns> internal static FixedSchema NewInstance(JToken jtok, PropertyMap props, SchemaNames names, string encspace) { SchemaName name = NamedSchema.GetName(jtok, encspace); var aliases = NamedSchema.GetAliases(jtok, name.Space, name.EncSpace); return(new FixedSchema(name, aliases, JsonHelper.GetRequiredInteger(jtok, "size"), props, names)); }
/// <summary> /// Static function to return new instance of the fixed schema class /// </summary> /// <param name="jtok">JSON object for the fixed schema</param> /// <param name="props">dictionary that provides access to custom properties</param> /// <param name="names">list of named schema already parsed in</param> /// <param name="encspace">enclosing namespace of the fixed schema</param> /// <returns></returns> internal static FixedSchema NewInstance(JToken jtok, PropertyMap props, SchemaNames names, string encspace) { SchemaName name = NamedSchema.GetName(jtok, encspace); var aliases = NamedSchema.GetAliases(jtok, name.Space, name.EncSpace); try { return(new FixedSchema(name, aliases, JsonHelper.GetRequiredInteger(jtok, "size"), props, names, JsonHelper.GetOptionalString(jtok, "doc"))); } catch (Exception e) { throw new SchemaParseException($"{e.Message} at '{jtok.Path}'", e); } }