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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 * new Serialization() | 176 * new Serialization() |
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' show Queue; |
186 | 187 |
187 part 'src/reader_writer.dart'; | 188 part 'src/reader_writer.dart'; |
188 part 'src/serialization_rule.dart'; | 189 part 'src/serialization_rule.dart'; |
189 part 'src/basic_rule.dart'; | 190 part 'src/basic_rule.dart'; |
190 part 'src/format.dart'; | 191 part 'src/format.dart'; |
191 | 192 |
192 /** | 193 /** |
193 * This class defines a particular serialization scheme, in terms of | 194 * This class defines a particular serialization scheme, in terms of |
194 * [SerializationRule] instances, and supports reading and writing them. | 195 * [SerializationRule] instances, and supports reading and writing them. |
195 * See library comment for examples of usage. | 196 * See library comment for examples of usage. |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 } | 457 } |
457 } | 458 } |
458 | 459 |
459 /** | 460 /** |
460 * An exception class for errors during serialization. | 461 * An exception class for errors during serialization. |
461 */ | 462 */ |
462 class SerializationException implements Exception { | 463 class SerializationException implements Exception { |
463 final String message; | 464 final String message; |
464 const SerializationException([this.message]); | 465 const SerializationException([this.message]); |
465 } | 466 } |
OLD | NEW |