From c7facae78977adc3ff57aff214d2beed9039fbcf Mon Sep 17 00:00:00 2001 From: JamesNK Date: Sat, 6 Feb 2010 22:55:36 +0000 Subject: -Added GetSchema, CanRead, CanWrite to JsonConverter -Fix CustomCreationConverter erroring when writing JSON --- Src/Newtonsoft.Json/JsonConverter.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'Src/Newtonsoft.Json/JsonConverter.cs') 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 /// true if this instance can convert the specified object type; otherwise, false. /// public abstract bool CanConvert(Type objectType); + + /// + /// Gets the of the JSON produced by the JsonConverter. + /// + /// The of the JSON produced by the JsonConverter. + public virtual JsonSchema GetSchema() + { + return null; + } + + /// + /// Gets a value indicating whether this can read JSON. + /// + /// true if this can read JSON; otherwise, false. + public virtual bool CanRead + { + get { return true; } + } + + /// + /// Gets a value indicating whether this can write JSON. + /// + /// true if this can write JSON; otherwise, false. + public virtual bool CanWrite + { + get { return true; } + } } } \ No newline at end of file -- cgit v1.2.3