JsonConverterFactory 类
定义
支持使用工厂模式转换多种类型。Supports converting several types by using a factory pattern.
public ref class JsonConverterFactory abstract : System::Text::Json::Serialization::JsonConverter
public abstract class JsonConverterFactory : System.Text.Json.Serialization.JsonConverter
type JsonConverterFactory = class
inherit JsonConverter
Public MustInherit Class JsonConverterFactory
Inherits JsonConverter
- 继承
- 派生
注解
这适用于支持泛型的转换器,如的转换器 List<T> 。This is useful for converters supporting generics, such as a converter for List<T>.
有关详细信息,请参阅 如何编写用于 JSON 序列化的自定义转换器。For more information, see How to write custom converters for JSON serialization.
构造函数
JsonConverterFactory() |
在派生类中重写时,初始化 JsonConverterFactory 类的新实例。When overidden in a derived class, initializes a new instance of the JsonConverterFactory class. |
方法
CanConvert(Type) |
在派生类中重写时,确定转换器实例是否可以转换指定的对象类型。When overridden in a derived class, determines whether the converter instance can convert the specified object type. (继承自 JsonConverter) |
CreateConverter(Type, JsonSerializerOptions) |
创建指定类型的转换器。Creates a converter for a specified type. |
Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
ToString() |
返回表示当前对象的字符串。Returns a string that represents the current object. (继承自 Object) |