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 * ## Installing ## | 10 * ## Installing ## |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 * ..addRuleFor(new Person(), constructorFields: ["name"]) | 200 * ..addRuleFor(new Person(), constructorFields: ["name"]) |
201 * ..namedObjects['Person'] = reflect(new Person()).type; | 201 * ..namedObjects['Person'] = reflect(new Person()).type; |
202 * | 202 * |
203 * [pub]: http://pub.dartlang.org | 203 * [pub]: http://pub.dartlang.org |
204 * [pkg]: http://pub.dartlang.org/packages/serialization | 204 * [pkg]: http://pub.dartlang.org/packages/serialization |
205 */ | 205 */ |
206 library serialization; | 206 library serialization; |
207 | 207 |
208 import 'src/mirrors_helpers.dart'; | 208 import 'src/mirrors_helpers.dart'; |
209 import 'src/serialization_helpers.dart'; | 209 import 'src/serialization_helpers.dart'; |
210 import 'dart:async'; | |
211 import 'dart:json' as json; | |
212 import 'dart:collection'; | 210 import 'dart:collection'; |
213 | 211 |
214 part 'src/reader_writer.dart'; | 212 part 'src/reader_writer.dart'; |
215 part 'src/serialization_rule.dart'; | 213 part 'src/serialization_rule.dart'; |
216 part 'src/basic_rule.dart'; | 214 part 'src/basic_rule.dart'; |
217 part 'src/format.dart'; | 215 part 'src/format.dart'; |
218 | 216 |
219 /** | 217 /** |
220 * This class defines a particular serialization scheme, in terms of | 218 * This class defines a particular serialization scheme, in terms of |
221 * [SerializationRule] instances, and supports reading and writing them. | 219 * [SerializationRule] instances, and supports reading and writing them. |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 } | 495 } |
498 | 496 |
499 /** | 497 /** |
500 * An exception class for errors during serialization. | 498 * An exception class for errors during serialization. |
501 */ | 499 */ |
502 class SerializationException implements Exception { | 500 class SerializationException implements Exception { |
503 final String message; | 501 final String message; |
504 const SerializationException(this.message); | 502 const SerializationException(this.message); |
505 String toString() => "SerializationException($message)"; | 503 String toString() => "SerializationException($message)"; |
506 } | 504 } |
OLD | NEW |