| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * This provides a general-purpose serialization facility for Dart objects. A | 6 * This provides a general-purpose serialization facility for Dart objects. A |
| 7 * [Serialization] is defined in terms of [SerializationRule]s and supports | 7 * [Serialization] is defined in terms of [SerializationRule]s and supports |
| 8 * reading and writing to different formats. | 8 * reading and writing to different formats. |
| 9 * | 9 * |
| 10 * Setup | 10 * Setup |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 * ..addRuleFor(new Person(), constructorFields: ["name"]) | 177 * ..addRuleFor(new Person(), constructorFields: ["name"]) |
| 178 * ..namedObjects['Person'] = reflect(new Person()).type; | 178 * ..namedObjects['Person'] = reflect(new Person()).type; |
| 179 */ | 179 */ |
| 180 library serialization; | 180 library serialization; |
| 181 | 181 |
| 182 import 'src/mirrors_helpers.dart'; | 182 import 'src/mirrors_helpers.dart'; |
| 183 import 'src/serialization_helpers.dart'; | 183 import 'src/serialization_helpers.dart'; |
| 184 import 'dart:async'; | 184 import 'dart:async'; |
| 185 import 'dart:json' as json; | 185 import 'dart:json' as json; |
| 186 import 'dart:collection'; | 186 import 'dart:collection'; |
| 187 // TODO(alanknight): Ugh. Remove this if we can resolve bug 7982/7940. | |
| 188 import 'dart:collection-dev'; | |
| 189 | 187 |
| 190 part 'src/reader_writer.dart'; | 188 part 'src/reader_writer.dart'; |
| 191 part 'src/serialization_rule.dart'; | 189 part 'src/serialization_rule.dart'; |
| 192 part 'src/basic_rule.dart'; | 190 part 'src/basic_rule.dart'; |
| 193 part 'src/format.dart'; | 191 part 'src/format.dart'; |
| 194 | 192 |
| 195 /** | 193 /** |
| 196 * This class defines a particular serialization scheme, in terms of | 194 * This class defines a particular serialization scheme, in terms of |
| 197 * [SerializationRule] instances, and supports reading and writing them. | 195 * [SerializationRule] instances, and supports reading and writing them. |
| 198 * See library comment for examples of usage. | 196 * See library comment for examples of usage. |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 } | 460 } |
| 463 | 461 |
| 464 /** | 462 /** |
| 465 * An exception class for errors during serialization. | 463 * An exception class for errors during serialization. |
| 466 */ | 464 */ |
| 467 class SerializationException implements Exception { | 465 class SerializationException implements Exception { |
| 468 final String message; | 466 final String message; |
| 469 const SerializationException([this.message]); | 467 const SerializationException([this.message]); |
| 470 toString() => "SerializationException($message)"; | 468 toString() => "SerializationException($message)"; |
| 471 } | 469 } |
| OLD | NEW |