OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:collection'; | 5 import 'dart:collection'; |
6 import 'dart:convert' hide JsonDecoder; | 6 import 'dart:convert' hide JsonDecoder; |
7 | 7 |
8 import 'package:analyzer_plugin/protocol/generated_protocol.dart'; | 8 import 'package:analyzer_plugin/protocol/generated_protocol.dart'; |
9 import 'package:analyzer_plugin/protocol/protocol.dart'; | 9 import 'package:analyzer_plugin/protocol/protocol.dart'; |
10 | 10 |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 _request, jsonPath, buffer.toString())); | 464 _request, jsonPath, buffer.toString())); |
465 } | 465 } |
466 | 466 |
467 @override | 467 @override |
468 dynamic missingKey(String jsonPath, String key) { | 468 dynamic missingKey(String jsonPath, String key) { |
469 return new RequestFailure(RequestErrorFactory.invalidParameter( | 469 return new RequestFailure(RequestErrorFactory.invalidParameter( |
470 _request, jsonPath, 'Expected to contain key ${JSON.encode(key)}')); | 470 _request, jsonPath, 'Expected to contain key ${JSON.encode(key)}')); |
471 } | 471 } |
472 } | 472 } |
473 | 473 |
| 474 abstract class RequestParams implements HasToJson { |
| 475 /** |
| 476 * Return a request whose parameters are taken from this object and that has |
| 477 * the given [id]. |
| 478 */ |
| 479 Request toRequest(String id); |
| 480 } |
| 481 |
474 /** | 482 /** |
475 * JsonDecoder for decoding responses from the server. This is intended to be | 483 * JsonDecoder for decoding responses from the server. This is intended to be |
476 * used only for testing. Errors are reported using bare [Exception] objects. | 484 * used only for testing. Errors are reported using bare [Exception] objects. |
477 */ | 485 */ |
478 class ResponseDecoder extends JsonDecoder { | 486 class ResponseDecoder extends JsonDecoder { |
479 @override | 487 @override |
480 final RefactoringKind refactoringKind; | 488 final RefactoringKind refactoringKind; |
481 | 489 |
482 ResponseDecoder(this.refactoringKind); | 490 ResponseDecoder(this.refactoringKind); |
483 | 491 |
(...skipping 21 matching lines...) Expand all Loading... |
505 /** | 513 /** |
506 * The result data associated with a response. | 514 * The result data associated with a response. |
507 */ | 515 */ |
508 abstract class ResponseResult implements HasToJson { | 516 abstract class ResponseResult implements HasToJson { |
509 /** | 517 /** |
510 * Return a response whose result data is this object for the request with the | 518 * Return a response whose result data is this object for the request with the |
511 * given [id]. | 519 * given [id]. |
512 */ | 520 */ |
513 Response toResponse(String id); | 521 Response toResponse(String id); |
514 } | 522 } |
OLD | NEW |