public static void Init(TypeMap types, Class2TypeMap class2type) { RuntimeExceptionSerializer.Init( types.Get(ETCH_RUNTIME_EXCEPTION_TYPE_NAME), class2type); ListSerializer.Init( types.Get(ETCH_LIST_TYPE_NAME), class2type); MapSerializer.Init( types.Get(ETCH_MAP_TYPE_NAME), class2type); /* SetSerializer.Init( * types.Get(ETCH_SET_TYPE_NAME), class2type); */ DateSerializer.Init( types.Get(ETCH_DATETIME_TYPE_NAME), class2type); AuthExceptionSerializer.Init( types.Get(ETCH_AUTH_EXCEPTION_TYPE_NAME), class2type); XType t3 = types.Get(ETCH_EXCEPTION_MESSAGE_NAME); t3.PutValidator(_mf_result, Validator_RuntimeException.Get()); t3.PutValidator(_mf__messageId, Validator_long.Get(0)); t3.PutValidator(_mf__inReplyTo, Validator_long.Get(0)); }
public static void Init(XType type, Class2TypeMap class2type) { Field field = type.GetField(FIELD_NAME); class2type.Add(typeof(_Etch_RuntimeException), type); type.SetComponentType(typeof(_Etch_RuntimeException)); type.SetImportExportHelper(new RuntimeExceptionSerializer(type, field)); type.PutValidator(field, Validator_string.Get(0)); type.Lock(); }
/// <summary> /// Adds all the mappings from other to this /// </summary> /// <param name="other"></param> public void AddAll(Class2TypeMap other) { if (locked) { throw new Exception("locked"); } foreach (KeyValuePair <Type, XType> me in other.c2t) { Add(me.Key, me.Value); } }
/// <summary> /// Constructs the DefaultValueFactory. /// </summary> /// <param name="uri"></param> /// <param name="types"></param> /// <param name="class2type"></param> public DefaultValueFactory(String uri, TypeMap types, Class2TypeMap class2type) { URL u = new URL(uri); String s = u.GetTerm("DefaultValueFactory.level", "FULL"); level = (Validator.Level)Enum.Parse(typeof(Validator.Level), s); this.types = types; this.class2type = class2type; _mt__Etch_RuntimeException = types.Get(ETCH_RUNTIME_EXCEPTION_TYPE_NAME); _mt__Etch_AuthException = types.Get(ETCH_AUTH_EXCEPTION_TYPE_NAME); _mt__exception = types.Get(ETCH_EXCEPTION_MESSAGE_NAME); _mt__Etch_List = types.Get(ETCH_LIST_TYPE_NAME); _mt__Etch_Map = types.Get(ETCH_MAP_TYPE_NAME); _mt__Etch_Set = types.Get(ETCH_SET_TYPE_NAME); _mt__Etch_Datetime = types.Get(ETCH_DATETIME_TYPE_NAME); }