| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 | 3 |
| 4 library engine.source.io; | 4 library engine.source.io; |
| 5 | 5 |
| 6 import 'source.dart'; | 6 import 'source.dart'; |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 import 'dart:uri'; | 8 import 'dart:uri'; |
| 9 import 'java_core.dart'; | 9 import 'java_core.dart'; |
| 10 import 'java_io.dart'; | 10 import 'java_io.dart'; |
| 11 import 'package:analyzer-experimental/src/generated/sdk.dart' show DartSdk; | 11 import 'package:analyzer_experimental/src/generated/sdk.dart' show DartSdk; |
| 12 export 'source.dart'; | 12 export 'source.dart'; |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * Instances of the class {@code FileBasedSource} implement a source that repres
ents a file. | 15 * Instances of the class {@code FileBasedSource} implement a source that repres
ents a file. |
| 16 * @coverage dart.engine.source | 16 * @coverage dart.engine.source |
| 17 */ | 17 */ |
| 18 class FileBasedSource implements Source { | 18 class FileBasedSource implements Source { |
| 19 /** | 19 /** |
| 20 * The source factory that created this source and that should be used to reso
lve URI's against | 20 * The source factory that created this source and that should be used to reso
lve URI's against |
| 21 * this source. | 21 * this source. |
| 22 */ | 22 */ |
| 23 SourceFactory _factory; | 23 SourceFactory _factory; |
| 24 /** | 24 /** |
| 25 * The file represented by this source. | 25 * The file represented by this source. |
| 26 */ | 26 */ |
| 27 JavaFile _file; | 27 JavaFile _file; |
| 28 /** | 28 /** |
| 29 * A flag indicating whether this source is in one of the system libraries. | 29 * A flag indicating whether this source is in one of the system libraries. |
| 30 */ | 30 */ |
| 31 bool _inSystemLibrary = false; | 31 bool _inSystemLibrary = false; |
| 32 /** | 32 /** |
| 33 * Initialize a newly created source object. The source object is assumed to n
ot be in a system | 33 * Initialize a newly created source object. The source object is assumed to n
ot be in a system |
| 34 * library. | 34 * library. |
| 35 * @param factory the source factory that created this source | 35 * @param factory the source factory that created this source |
| 36 * @param file the file represented by this source | 36 * @param file the file represented by this source |
| 37 */ | 37 */ |
| 38 FileBasedSource.con1(SourceFactory factory, JavaFile file) { | 38 FileBasedSource.con1(SourceFactory factory, JavaFile file) { |
| 39 _jtd_constructor_285_impl(factory, file); | 39 _jtd_constructor_296_impl(factory, file); |
| 40 } | 40 } |
| 41 _jtd_constructor_285_impl(SourceFactory factory, JavaFile file) { | 41 _jtd_constructor_296_impl(SourceFactory factory, JavaFile file) { |
| 42 _jtd_constructor_286_impl(factory, file, false); | 42 _jtd_constructor_297_impl(factory, file, false); |
| 43 } | 43 } |
| 44 /** | 44 /** |
| 45 * Initialize a newly created source object. | 45 * Initialize a newly created source object. |
| 46 * @param factory the source factory that created this source | 46 * @param factory the source factory that created this source |
| 47 * @param file the file represented by this source | 47 * @param file the file represented by this source |
| 48 * @param inSystemLibrary {@code true} if this source is in one of the system
libraries | 48 * @param inSystemLibrary {@code true} if this source is in one of the system
libraries |
| 49 */ | 49 */ |
| 50 FileBasedSource.con2(SourceFactory factory2, JavaFile file3, bool inSystemLibr
ary2) { | 50 FileBasedSource.con2(SourceFactory factory2, JavaFile file3, bool inSystemLibr
ary2) { |
| 51 _jtd_constructor_286_impl(factory2, file3, inSystemLibrary2); | 51 _jtd_constructor_297_impl(factory2, file3, inSystemLibrary2); |
| 52 } | 52 } |
| 53 _jtd_constructor_286_impl(SourceFactory factory2, JavaFile file3, bool inSyste
mLibrary2) { | 53 _jtd_constructor_297_impl(SourceFactory factory2, JavaFile file3, bool inSyste
mLibrary2) { |
| 54 this._factory = factory2; | 54 this._factory = factory2; |
| 55 this._file = file3; | 55 this._file = file3; |
| 56 this._inSystemLibrary = inSystemLibrary2; | 56 this._inSystemLibrary = inSystemLibrary2; |
| 57 } | 57 } |
| 58 bool operator ==(Object object) => object != null && identical(this.runtimeTyp
e, object.runtimeType) && _file == ((object as FileBasedSource))._file; | 58 bool operator ==(Object object) => object != null && identical(this.runtimeTyp
e, object.runtimeType) && _file == ((object as FileBasedSource))._file; |
| 59 bool exists() => _file.exists(); | 59 bool exists() => _file.exists(); |
| 60 void getContents(Source_ContentReceiver receiver) { | 60 void getContents(Source_ContentReceiver receiver) { |
| 61 { | 61 { |
| 62 String contents = _factory.getContents(this); | 62 String contents = _factory.getContents(this); |
| 63 if (contents != null) { | 63 if (contents != null) { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 /** | 209 /** |
| 210 * The container's path (not {@code null}). | 210 * The container's path (not {@code null}). |
| 211 */ | 211 */ |
| 212 String _path; | 212 String _path; |
| 213 /** | 213 /** |
| 214 * Construct a container representing the specified directory and containing a
ny sources whose{@link Source#getFullName()} starts with the directory's path. T
his is a convenience method, | 214 * Construct a container representing the specified directory and containing a
ny sources whose{@link Source#getFullName()} starts with the directory's path. T
his is a convenience method, |
| 215 * fully equivalent to {@link DirectoryBasedSourceContainer#DirectoryBasedSour
ceContainer(String)}. | 215 * fully equivalent to {@link DirectoryBasedSourceContainer#DirectoryBasedSour
ceContainer(String)}. |
| 216 * @param directory the directory (not {@code null}) | 216 * @param directory the directory (not {@code null}) |
| 217 */ | 217 */ |
| 218 DirectoryBasedSourceContainer.con1(JavaFile directory) { | 218 DirectoryBasedSourceContainer.con1(JavaFile directory) { |
| 219 _jtd_constructor_283_impl(directory); | 219 _jtd_constructor_294_impl(directory); |
| 220 } | 220 } |
| 221 _jtd_constructor_283_impl(JavaFile directory) { | 221 _jtd_constructor_294_impl(JavaFile directory) { |
| 222 _jtd_constructor_284_impl(directory.getPath()); | 222 _jtd_constructor_295_impl(directory.getPath()); |
| 223 } | 223 } |
| 224 /** | 224 /** |
| 225 * Construct a container representing the specified path and containing any so
urces whose{@link Source#getFullName()} starts with the specified path. | 225 * Construct a container representing the specified path and containing any so
urces whose{@link Source#getFullName()} starts with the specified path. |
| 226 * @param path the path (not {@code null} and not empty) | 226 * @param path the path (not {@code null} and not empty) |
| 227 */ | 227 */ |
| 228 DirectoryBasedSourceContainer.con2(String path3) { | 228 DirectoryBasedSourceContainer.con2(String path3) { |
| 229 _jtd_constructor_284_impl(path3); | 229 _jtd_constructor_295_impl(path3); |
| 230 } | 230 } |
| 231 _jtd_constructor_284_impl(String path3) { | 231 _jtd_constructor_295_impl(String path3) { |
| 232 this._path = appendFileSeparator(path3); | 232 this._path = appendFileSeparator(path3); |
| 233 } | 233 } |
| 234 bool contains(Source source) => source.fullName.startsWith(_path); | 234 bool contains(Source source) => source.fullName.startsWith(_path); |
| 235 bool operator ==(Object obj) => (obj is DirectoryBasedSourceContainer) && ((ob
j as DirectoryBasedSourceContainer)).path == path; | 235 bool operator ==(Object obj) => (obj is DirectoryBasedSourceContainer) && ((ob
j as DirectoryBasedSourceContainer)).path == path; |
| 236 /** | 236 /** |
| 237 * Answer the receiver's path, used to determine if a source is contained in t
he receiver. | 237 * Answer the receiver's path, used to determine if a source is contained in t
he receiver. |
| 238 * @return the path (not {@code null}, not empty) | 238 * @return the path (not {@code null}, not empty) |
| 239 */ | 239 */ |
| 240 String get path => _path; | 240 String get path => _path; |
| 241 int get hashCode => _path.hashCode; | 241 int get hashCode => _path.hashCode; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 261 */ | 261 */ |
| 262 FileUriResolver() : super() { | 262 FileUriResolver() : super() { |
| 263 } | 263 } |
| 264 Source resolveAbsolute(SourceFactory factory, Uri uri) { | 264 Source resolveAbsolute(SourceFactory factory, Uri uri) { |
| 265 if (!isFileUri(uri)) { | 265 if (!isFileUri(uri)) { |
| 266 return null; | 266 return null; |
| 267 } | 267 } |
| 268 return new FileBasedSource.con1(factory, new JavaFile.fromUri(uri)); | 268 return new FileBasedSource.con1(factory, new JavaFile.fromUri(uri)); |
| 269 } | 269 } |
| 270 } | 270 } |
| OLD | NEW |