OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library analyzer.src.generated.source_io; | 5 library analyzer.src.generated.source_io; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
10 import 'package:analyzer/src/generated/java_core.dart'; | 10 import 'package:analyzer/src/generated/java_core.dart'; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 return path; | 78 return path; |
79 } | 79 } |
80 return "$path${JavaFile.separator}"; | 80 return "$path${JavaFile.separator}"; |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 /** | 84 /** |
85 * Instances of the class [ExplicitSourceResolver] map URIs to files on disk | 85 * Instances of the class [ExplicitSourceResolver] map URIs to files on disk |
86 * using a fixed mapping provided at construction time. | 86 * using a fixed mapping provided at construction time. |
87 */ | 87 */ |
| 88 @deprecated |
88 class ExplicitSourceResolver extends UriResolver { | 89 class ExplicitSourceResolver extends UriResolver { |
89 final Map<Uri, JavaFile> uriToFileMap; | 90 final Map<Uri, JavaFile> uriToFileMap; |
90 final Map<String, Uri> pathToUriMap; | 91 final Map<String, Uri> pathToUriMap; |
91 | 92 |
92 /** | 93 /** |
93 * Construct an [ExplicitSourceResolver] based on the given [uriToFileMap]. | 94 * Construct an [ExplicitSourceResolver] based on the given [uriToFileMap]. |
94 */ | 95 */ |
95 ExplicitSourceResolver(Map<Uri, JavaFile> uriToFileMap) | 96 ExplicitSourceResolver(Map<Uri, JavaFile> uriToFileMap) |
96 : uriToFileMap = uriToFileMap, | 97 : uriToFileMap = uriToFileMap, |
97 pathToUriMap = _computePathToUriMap(uriToFileMap); | 98 pathToUriMap = _computePathToUriMap(uriToFileMap); |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 } | 567 } |
567 | 568 |
568 /** | 569 /** |
569 * Return `true` if the given URI is a `file` URI. | 570 * Return `true` if the given URI is a `file` URI. |
570 * | 571 * |
571 * @param uri the URI being tested | 572 * @param uri the URI being tested |
572 * @return `true` if the given URI is a `file` URI | 573 * @return `true` if the given URI is a `file` URI |
573 */ | 574 */ |
574 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; | 575 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; |
575 } | 576 } |
OLD | NEW |