Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/Newtonsoft.Json.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamesNK <james@newtonking.com>2010-02-07 01:55:36 +0300
committerJamesNK <james@newtonking.com>2010-02-07 01:55:36 +0300
commitc7facae78977adc3ff57aff214d2beed9039fbcf (patch)
tree8062b4e6482ca4f627dc86fc4c50cfa493f7d1ca /Src/Newtonsoft.Json/JsonConverter.cs
parent992985bd7b981bef99a6d979446128a9d40a6607 (diff)
-Added GetSchema, CanRead, CanWrite to JsonConverter
-Fix CustomCreationConverter erroring when writing JSON
Diffstat (limited to 'Src/Newtonsoft.Json/JsonConverter.cs')
-rw-r--r--Src/Newtonsoft.Json/JsonConverter.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/Src/Newtonsoft.Json/JsonConverter.cs b/Src/Newtonsoft.Json/JsonConverter.cs
index 27f356c..493e252 100644
--- a/Src/Newtonsoft.Json/JsonConverter.cs
+++ b/Src/Newtonsoft.Json/JsonConverter.cs
@@ -27,6 +27,7 @@ using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json.Utilities;
+using Newtonsoft.Json.Schema;
namespace Newtonsoft.Json
{
@@ -60,5 +61,32 @@ namespace Newtonsoft.Json
/// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.
/// </returns>
public abstract bool CanConvert(Type objectType);
+
+ /// <summary>
+ /// Gets the <see cref="JsonSchema"/> of the JSON produced by the JsonConverter.
+ /// </summary>
+ /// <returns>The <see cref="JsonSchema"/> of the JSON produced by the JsonConverter.</returns>
+ public virtual JsonSchema GetSchema()
+ {
+ return null;
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this <see cref="JsonConverter"/> can read JSON.
+ /// </summary>
+ /// <value><c>true</c> if this <see cref="JsonConverter"/> can read JSON; otherwise, <c>false</c>.</value>
+ public virtual bool CanRead
+ {
+ get { return true; }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this <see cref="JsonConverter"/> can write JSON.
+ /// </summary>
+ /// <value><c>true</c> if this <see cref="JsonConverter"/> can write JSON; otherwise, <c>false</c>.</value>
+ public virtual bool CanWrite
+ {
+ get { return true; }
+ }
}
} \ No newline at end of file