JsonConverterAttribute クラス

定義

プロパティまたは型に配置する場合は、使用するコンバーターの種類を指定します。

public ref class JsonConverterAttribute : System::Text::Json::Serialization::JsonAttribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false)]
public class JsonConverterAttribute : System.Text.Json.Serialization.JsonAttribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false)]
public class JsonConverterAttribute : System.Text.Json.Serialization.JsonAttribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false)]
public class JsonConverterAttribute : System.Text.Json.Serialization.JsonAttribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false)>]
type JsonConverterAttribute = class
    inherit JsonAttribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false)>]
type JsonConverterAttribute = class
    inherit JsonAttribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false)>]
type JsonConverterAttribute = class
    inherit JsonAttribute
Public Class JsonConverterAttribute
Inherits JsonAttribute
継承
JsonConverterAttribute
属性

注釈

指定したコンバーター型は、 JsonConverterから派生する必要があります。

プロパティに配置すると、指定したコンバーターが常に使用されます。

型に配置すると、互換性のあるコンバーターが JsonSerializerOptions.Converters コレクションに追加されていないか、同じ型のプロパティに別の JsonConverterAttribute がない限り、指定されたコンバーターが使用されます。

詳細については、「 JSON シリアル化用のカスタム コンバーターを記述する方法」を参照してください。

コンストラクター

名前 説明
JsonConverterAttribute()

JsonConverterAttributeの新しいインスタンスを初期化します。

JsonConverterAttribute(Type)

指定したコンバーター型を使用して、 JsonConverterAttribute の新しいインスタンスを初期化します。

プロパティ

名前 説明
ConverterType

JsonConverterAttributeの型を取得します。型なしで作成された場合はnullを取得します。

TypeId

派生クラスで実装されている場合は、この Attributeの一意の識別子を取得します。

(継承元 Attribute)

メソッド

名前 説明
CreateConverter(Type)

派生クラスでオーバーライドされ、 ConverterTypenull場合、派生クラスは追加の状態を渡すために JsonConverter を作成できます。

Equals(Object)

このインスタンスが指定したオブジェクトと等しいかどうかを示す値を返します。

(継承元 Attribute)
GetHashCode()

このインスタンスのハッシュ コードを返します。

(継承元 Attribute)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IsDefaultAttribute()

派生クラスでオーバーライドされた場合、このインスタンスの値が派生クラスの既定値であるかどうかを示します。

(継承元 Attribute)
Match(Object)

派生クラスでオーバーライドされた場合、このインスタンスが指定したオブジェクトと等しいかどうかを示す値を返します。

(継承元 Attribute)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象