REST.JsonReflect.TTypeMarshaller.RegisterConverter
Delphi
procedure RegisterConverter(clazz: TClass; Field: string; Converter: TConverterEvent); overload;
procedure RegisterConverter(clazz: TClass; Field: string; func: TObjectsConverter); overload;
procedure RegisterConverter(clazz: TClass; Field: string; func: TObjectConverter); overload;
procedure RegisterConverter(clazz: TClass; Field: string; func: TStringsConverter); overload;
procedure RegisterConverter(clazz: TClass; Field: string; func: TStringConverter); overload;
procedure RegisterConverter(clazz: TClass; func: TTypeObjectsConverter); overload;
procedure RegisterConverter(clazz: TClass; func: TTypeObjectConverter); overload;
procedure RegisterConverter(clazz: TClass; func: TTypeStringsConverter); overload;
procedure RegisterConverter(clazz: TClass; func: TTypeStringConverter); overload;
C++
void __fastcall RegisterConverter(System::TClass clazz, System::UnicodeString Field, TConverterEvent* Converter)/* overload */;
void __fastcall RegisterConverter(System::TClass clazz, System::UnicodeString Field, _di_TObjectsConverter func)/* overload */;
void __fastcall RegisterConverter(System::TClass clazz, System::UnicodeString Field, _di_TObjectConverter func)/* overload */;
void __fastcall RegisterConverter(System::TClass clazz, System::UnicodeString Field, _di_TStringsConverter func)/* overload */;
void __fastcall RegisterConverter(System::TClass clazz, System::UnicodeString Field, _di_TStringConverter func)/* overload */;
void __fastcall RegisterConverter(System::TClass clazz, _di_TTypeObjectsConverter func)/* overload */;
void __fastcall RegisterConverter(System::TClass clazz, _di_TTypeObjectConverter func)/* overload */;
void __fastcall RegisterConverter(System::TClass clazz, _di_TTypeStringsConverter func)/* overload */;
void __fastcall RegisterConverter(System::TClass clazz, _di_TTypeStringConverter func)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | REST.JsonReflect.pas REST.JsonReflect.hpp |
REST.JsonReflect | TTypeMarshaller |
Description
Registers the specified converter event of function or a converter event for the specified combination of class and field name or for the specified class.
When you register a function instead of a converter event, RegisterConverter creates a converter event for you, associates the specified function to the matching function of the new converter event, and registers the new converter event. The following table shows how each type of function matches a converter event function:
Function type | Matching TConverterEvent function |
---|---|
Once you register a converter event, TTypeMarshaller takes ownership of that converter event. That is, when you destroy your instance of TTypeMarshaller, the converter event objects are destroyed automatically as well.