Permalink
Browse files

Added back JsonHttpMessageConverter with Obsolete attribute

  • Loading branch information...
1 parent f5fde6f commit c58743459ffc2ffe1bbd8e171e311198c9f1a1f3 @bbaia bbaia committed Jan 12, 2012
View
@@ -3,6 +3,4 @@ Changes (1.0 to 1.1)
1. Interface IRestAsyncOperations has been removed and merged with IRestOperations.
-2. Renamed JsonHttpMessageConverter into DataContractJsonHttpMessageConverter for better consistency.
-
-3. Changed HttpMethod type from Enum to Class to allow additional methods.
+2. Changed HttpMethod type from Enum to Class to allow additional methods.
@@ -851,6 +851,8 @@ template.PostForLocation("http://example.com/myFileUpload", parts);</programlist
<section id="http-datacontractjsonconverter">
<title>DataContractJsonHttpMessageConverter</title>
+ <para>[Since 1.1: Previously named 'JsonHttpMessageConverter']</para>
+
<para>Supports .NET Framework 3.5, 4.0, Silverlight and Windows
Phone.</para>
@@ -0,0 +1,63 @@
+#if NET_3_5 || SILVERLIGHT
+#region License
+
+/*
+ * Copyright 2002-2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#endregion
+
+using System;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Json;
+
+namespace Spring.Http.Converters.Json
+{
+ /// <summary>
+ /// Implementation of <see cref="IHttpMessageConverter"/> that can read and write JSON
+ /// using <see cref="DataContractJsonSerializer"/>.
+ /// </summary>
+ /// <remarks>
+ /// By default, this converter supports 'application/json' media type.
+ /// This can be overridden by setting the <see cref="P:SupportedMediaTypes"/> property.
+ /// </remarks>
+ /// <author>Bruno Baia</author>
+ [Obsolete("This class has been renamed to DataContractJsonHttpMessageConverter for better consistency.")]
+ public class JsonHttpMessageConverter : DataContractJsonHttpMessageConverter
+ {
+ /// <summary>
+ /// Creates a new instance of the <see cref="JsonHttpMessageConverter"/>
+ /// with the media type 'application/json'.
+ /// </summary>
+ public JsonHttpMessageConverter() :
+ base()
+ {
+ }
+
+ /// <summary>
+ /// Creates a new instance of the <see cref="JsonHttpMessageConverter"/>
+ /// with the media type 'application/json'.
+ /// </summary>
+ /// <param name="requiresAttribute">
+ /// If <c>true</c>, supports only classes decorated with
+ /// <see cref="DataContractAttribute"/> and <see cref="CollectionDataContractAttribute"/>.
+ /// </param>
+ public JsonHttpMessageConverter(bool requiresAttribute) :
+ base(requiresAttribute)
+ {
+ }
+ }
+}
+#endif
@@ -132,6 +132,7 @@
<Compile Include="Http\Converters\Feed\AbstractFeedHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Feed\Rss20FeedHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\DataContractJsonHttpMessageConverter.cs" />
+ <Compile Include="Http\Converters\Json\JsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\SpringJsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\ResourceHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Xml\AbstractXmlHttpMessageConverter.cs" />
@@ -93,6 +93,7 @@
<Compile Include="Http\Converters\HttpMessageNotWritableException.cs" />
<Compile Include="Http\Converters\IHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\DataContractJsonHttpMessageConverter.cs" />
+ <Compile Include="Http\Converters\Json\JsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\SpringJsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\ResourceHttpMessageConverter.cs" />
<Compile Include="Http\Converters\StringHttpMessageConverter.cs" />
@@ -132,6 +132,7 @@
<Compile Include="Http\Converters\Feed\AbstractFeedHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Feed\Rss20FeedHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\DataContractJsonHttpMessageConverter.cs" />
+ <Compile Include="Http\Converters\Json\JsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\SpringJsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\ResourceHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Xml\AbstractXmlHttpMessageConverter.cs" />
@@ -137,6 +137,7 @@
<Compile Include="Http\Converters\Feed\AbstractFeedHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Feed\Rss20FeedHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\DataContractJsonHttpMessageConverter.cs" />
+ <Compile Include="Http\Converters\Json\JsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\SpringJsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\ResourceHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Xml\AbstractXmlHttpMessageConverter.cs" />
@@ -94,6 +94,7 @@
<Compile Include="Http\Converters\HttpMessageNotWritableException.cs" />
<Compile Include="Http\Converters\IHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\DataContractJsonHttpMessageConverter.cs" />
+ <Compile Include="Http\Converters\Json\JsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\SpringJsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\ResourceHttpMessageConverter.cs" />
<Compile Include="Http\Converters\StringHttpMessageConverter.cs" />
@@ -163,6 +163,7 @@
<Compile Include="Http\Converters\IHttpMessageConverter.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="Http\Converters\Json\JsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\DataContractJsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\SpringJsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\ResourceHttpMessageConverter.cs" />
@@ -115,6 +115,7 @@
<Compile Include="Http\Converters\HttpMessageNotWritableException.cs" />
<Compile Include="Http\Converters\IHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\DataContractJsonHttpMessageConverter.cs" />
+ <Compile Include="Http\Converters\Json\JsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\SpringJsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\ResourceHttpMessageConverter.cs" />
<Compile Include="Http\Converters\StringHttpMessageConverter.cs" />
@@ -116,6 +116,7 @@
<Compile Include="Http\Converters\HttpMessageNotWritableException.cs" />
<Compile Include="Http\Converters\IHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\DataContractJsonHttpMessageConverter.cs" />
+ <Compile Include="Http\Converters\Json\JsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\SpringJsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\ResourceHttpMessageConverter.cs" />
<Compile Include="Http\Converters\StringHttpMessageConverter.cs" />
@@ -110,6 +110,7 @@
<Compile Include="Http\Converters\HttpMessageNotWritableException.cs" />
<Compile Include="Http\Converters\IHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\DataContractJsonHttpMessageConverter.cs" />
+ <Compile Include="Http\Converters\Json\JsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\SpringJsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\ResourceHttpMessageConverter.cs" />
<Compile Include="Http\Converters\StringHttpMessageConverter.cs" />
@@ -110,6 +110,7 @@
<Compile Include="Http\Converters\HttpMessageNotWritableException.cs" />
<Compile Include="Http\Converters\IHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\DataContractJsonHttpMessageConverter.cs" />
+ <Compile Include="Http\Converters\Json\JsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\Json\SpringJsonHttpMessageConverter.cs" />
<Compile Include="Http\Converters\ResourceHttpMessageConverter.cs" />
<Compile Include="Http\Converters\StringHttpMessageConverter.cs" />

0 comments on commit c587434

Please sign in to comment.