JsonConverterAttribute クラス

定義

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

public ref 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.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.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)>]
type JsonConverterAttribute = class
    inherit 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.Property | System.AttributeTargets.Struct, AllowMultiple=false)>]
type JsonConverterAttribute = class
    inherit JsonAttribute
Public Class JsonConverterAttribute
Inherits JsonAttribute
継承
JsonConverterAttribute
属性

注釈

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

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

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

詳細については、「 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)

適用対象