-Improved default null and value handing when JSON value is not compatible with property value

-Added interfaces, structs and enums as valid targets of JsonConverterAttribute
This commit is contained in:
JamesNK
2010-05-27 08:37:34 +00:00
parent fc6c041196
commit f5ed7be283
7 changed files with 59 additions and 4 deletions
+18
View File
@@ -336,6 +336,24 @@ namespace Newtonsoft.Json
}
}
internal static bool IsPrimitiveToken(JsonToken token)
{
switch (token)
{
case JsonToken.Integer:
case JsonToken.Float:
case JsonToken.String:
case JsonToken.Boolean:
case JsonToken.Undefined:
case JsonToken.Null:
case JsonToken.Date:
case JsonToken.Bytes:
return true;
default:
return false;
}
}
internal static bool IsStartToken(JsonToken token)
{
switch (token)