チェンジセット 1596 (default)
- 日時:
- 2023/08/20 4:22:02 (14ヵ月前)
- 場所:
- framework/trunk
- ファイル:
-
- 3個の追加
- 4個の更新
凡例:
- 未変更
- 追加
- 削除
-
framework/trunk/CoreLibrary/Sources/Json/JsonBeanInfoManager.cs
r900 r1596 40 40 delegate(Type type) 41 41 { 42 return new JsonBeanInfo(type); 42 return Attribute.IsDefined(type, typeof(JsonBeanAttribute)) 43 ? new JsonBeanInfo(type) 44 : null; 43 45 }); 44 46 … … 52 54 /// <returns> 53 55 /// <see cref="JsonBeanInfo"/> オブジェクト。 56 /// JSON ビーンではない場合は <see langword="null"/>。 54 57 /// </returns> 55 58 /// <exception cref="ArgumentNullException"> … … 75 78 /// <returns> 76 79 /// <see cref="JsonBeanInfo"/> オブジェクト。 80 /// JSON ビーンではない場合は <see langword="null"/>。 77 81 /// </returns> 78 82 /// <exception cref="ArgumentNullException"> -
framework/trunk/CoreLibrary/Sources/Json/JsonOperator.cs
r1547 r1596 1086 1086 { 1087 1087 bean = creator.CreateObject(parentBean); 1088 jsonBeanInfo = bean != null ? GetJsonBeanInfo(bean) : null;1088 jsonBeanInfo = bean != null ? JsonBeanInfoManager.Get(bean) : null; 1089 1089 } 1090 1090 else … … 1272 1272 1273 1273 /// <summary> 1274 /// 指定したインスタンスに対応する <see cref="JsonBeanInfo"/> を取得します。1275 /// </summary>1276 /// <param name="bean">1277 /// 対象のインスタンス。1278 /// </param>1279 /// <returns>1280 /// 対応する <see cref="JsonBeanInfo"/>。1281 /// JSON ビーンではない場合は <see langword="null"/> 参照です。1282 /// </returns>1283 private static JsonBeanInfo GetJsonBeanInfo(object bean)1284 {1285 Type beanType = bean.GetType();1286 return Attribute.IsDefined(beanType, typeof(JsonBeanAttribute))1287 ? JsonBeanInfoManager.Get(beanType)1288 : null;1289 }1290 1291 /// <summary>1292 1274 /// メンバに対応する <see cref="IJsonMemberAccessor"/> を取得します。 1293 1275 /// </summary> … … 1405 1387 { 1406 1388 // JSON ビーンの場合 1407 Type type = source.GetType();1408 if ( Attribute.IsDefined(type, typeof(JsonBeanAttribute)))1409 { 1410 JsonBeanInfoManager.Get(type).Save(writer, source);1389 JsonBeanInfo jsonBeanInfo = JsonBeanInfoManager.Get(source); 1390 if (jsonBeanInfo != null) 1391 { 1392 jsonBeanInfo.Save(writer, source); 1411 1393 return; 1412 1394 } -
framework/trunk/TestLibrary/TestLibrary.csproj
r1581 r1596 69 69 <Compile Include="Sources\GeneralWebServer.cs" /> 70 70 <Compile Include="Sources\InMemoryWebServer.cs" /> 71 <Compile Include="Sources\JsonExpectedData.cs" /> 72 <Compile Include="Sources\JsonNUnitExtensions.cs" /> 71 73 <Compile Include="Sources\NativeMethods.cs" /> 72 74 <Compile Include="Sources\NUnitTraceListener.cs" /> -
framework/trunk/TestTest/TestTest.csproj
r1576 r1596 51 51 <Compile Include="Sources\CascadingTraceListenerTest.cs" /> 52 52 <Compile Include="Sources\InMemoryWebServerTest.cs" /> 53 <Compile Include="Sources\JsonNUnitExtensionsTest.cs" /> 53 54 <Compile Include="Sources\RedirectTraceListenerTest.cs" /> 54 55 <Compile Include="Sources\TestTestBase.cs" />
※ 詳しい使い方は
TracChangeset を参照してください。