public virtual bool HandleNull { get { throw null; } }
public override bool CanConvert(System.Type typeToConvert) { throw null; }
public abstract T? Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options);
- public abstract void Write(System.Text.Json.Utf8JsonWriter writer, T value, System.Text.Json.JsonSerializerOptions options);
+ public abstract void Write(
+ System.Text.Json.Utf8JsonWriter writer,
+#nullable disable
+ T value,
+#nullable restore
+ System.Text.Json.JsonSerializerOptions options);
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple=false)]
public sealed partial class JsonExtensionDataAttribute : System.Text.Json.Serialization.JsonAttribute
/// and whether <see cref="JsonTokenType.Null"/> should be passed on deserialization.
/// </summary>
/// <remarks>
- /// The default value is <see langword="true"/> for converters for value types, and <see langword="false"/> for converters for reference types.
+ /// The default value is <see langword="true"/> for converters based on value types, and <see langword="false"/> for converters based on reference types.
/// </remarks>
public virtual bool HandleNull
{
/// <param name="typeToConvert">The <see cref="Type"/> being converted.</param>
/// <param name="options">The <see cref="JsonSerializerOptions"/> being used.</param>
/// <returns>The value that was converted.</returns>
+ /// <remarks>Note that the value of <seealso cref="HandleNull"/> determines if the converter handles null JSON tokens.</remarks>
public abstract T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options);
internal bool TryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out T? value)
/// cannot be created.
/// </remarks>
/// <param name="writer">The <see cref="Utf8JsonWriter"/> to write to.</param>
- /// <param name="value">The value to convert.</param>
+ /// <param name="value">The value to convert. Note that the value of <seealso cref="HandleNull"/> determines if the converter handles <see langword="null" /> values.</param>
/// <param name="options">The <see cref="JsonSerializerOptions"/> being used.</param>
- public abstract void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options);
+ public abstract void Write(
+ Utf8JsonWriter writer,
+#nullable disable // T may or may not be nullable depending on the derived type's overload.
+ T value,
+#nullable restore
+ JsonSerializerOptions options);
internal virtual T ReadWithQuotes(ref Utf8JsonReader reader)
{