| 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 library engine.source; | 3 library engine.source; |
| 4 import 'java_core.dart'; | 4 import 'java_core.dart'; |
| 5 import 'sdk.dart' show DartSdk; | 5 import 'sdk.dart' show DartSdk; |
| 6 import 'engine.dart' show AnalysisContext; | 6 import 'engine.dart' show AnalysisContext; |
| 7 /** | 7 /** |
| 8 * Instances of the class `SourceFactory` resolve possibly relative URI's agains
t an existing | 8 * Instances of the class `SourceFactory` resolve possibly relative URI's agains
t an existing |
| 9 * [Source]. | 9 * [Source]. |
| 10 * | 10 * |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * A cache of content used to override the default content of a source. | 26 * A cache of content used to override the default content of a source. |
| 27 */ | 27 */ |
| 28 ContentCache _contentCache; | 28 ContentCache _contentCache; |
| 29 | 29 |
| 30 /** | 30 /** |
| 31 * Initialize a newly created source factory. | 31 * Initialize a newly created source factory. |
| 32 * | 32 * |
| 33 * @param contentCache the cache holding content used to override the default
content of a source | 33 * @param contentCache the cache holding content used to override the default
content of a source |
| 34 * @param resolvers the resolvers used to resolve absolute URI's | 34 * @param resolvers the resolvers used to resolve absolute URI's |
| 35 */ | 35 */ |
| 36 SourceFactory.con1(ContentCache contentCache2, List<UriResolver> resolvers2) { | 36 SourceFactory.con1(ContentCache contentCache, List<UriResolver> resolvers) { |
| 37 _jtd_constructor_347_impl(contentCache2, resolvers2); | 37 this._contentCache = contentCache; |
| 38 } | 38 this._resolvers = resolvers; |
| 39 _jtd_constructor_347_impl(ContentCache contentCache2, List<UriResolver> resolv
ers2) { | |
| 40 this._contentCache = contentCache2; | |
| 41 this._resolvers = resolvers2; | |
| 42 } | 39 } |
| 43 | 40 |
| 44 /** | 41 /** |
| 45 * Initialize a newly created source factory. | 42 * Initialize a newly created source factory. |
| 46 * | 43 * |
| 47 * @param resolvers the resolvers used to resolve absolute URI's | 44 * @param resolvers the resolvers used to resolve absolute URI's |
| 48 */ | 45 */ |
| 49 SourceFactory.con2(List<UriResolver> resolvers) { | 46 SourceFactory.con2(List<UriResolver> resolvers) : this.con1(new ContentCache()
, resolvers); |
| 50 _jtd_constructor_348_impl(resolvers); | |
| 51 } | |
| 52 _jtd_constructor_348_impl(List<UriResolver> resolvers) { | |
| 53 _jtd_constructor_347_impl(new ContentCache(), resolvers); | |
| 54 } | |
| 55 | 47 |
| 56 /** | 48 /** |
| 57 * Return a source object representing the given absolute URI, or `null` if th
e URI is not a | 49 * Return a source object representing the given absolute URI, or `null` if th
e URI is not a |
| 58 * valid URI or if it is not an absolute URI. | 50 * valid URI or if it is not an absolute URI. |
| 59 * | 51 * |
| 60 * @param absoluteUri the absolute URI to be resolved | 52 * @param absoluteUri the absolute URI to be resolved |
| 61 * @return a source object representing the absolute URI | 53 * @return a source object representing the absolute URI |
| 62 */ | 54 */ |
| 63 Source forUri(String absoluteUri) { | 55 Source forUri(String absoluteUri) { |
| 64 try { | 56 try { |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 * does not want to spend the time to identify the kind. | 444 * does not want to spend the time to identify the kind. |
| 453 */ | 445 */ |
| 454 static final SourceKind UNKNOWN = new SourceKind('UNKNOWN', 3); | 446 static final SourceKind UNKNOWN = new SourceKind('UNKNOWN', 3); |
| 455 static final List<SourceKind> values = [HTML, LIBRARY, PART, UNKNOWN]; | 447 static final List<SourceKind> values = [HTML, LIBRARY, PART, UNKNOWN]; |
| 456 | 448 |
| 457 /// The name of this enum constant, as declared in the enum declaration. | 449 /// The name of this enum constant, as declared in the enum declaration. |
| 458 final String name; | 450 final String name; |
| 459 | 451 |
| 460 /// The position in the enum declaration. | 452 /// The position in the enum declaration. |
| 461 final int ordinal; | 453 final int ordinal; |
| 462 SourceKind(this.name, this.ordinal) { | 454 SourceKind(this.name, this.ordinal); |
| 463 } | |
| 464 int compareTo(SourceKind other) => ordinal - other.ordinal; | 455 int compareTo(SourceKind other) => ordinal - other.ordinal; |
| 465 int get hashCode => ordinal; | 456 int get hashCode => ordinal; |
| 466 String toString() => name; | 457 String toString() => name; |
| 467 } | 458 } |
| 468 /** | 459 /** |
| 469 * The enumeration `UriKind` defines the different kinds of URI's that are known
to the | 460 * The enumeration `UriKind` defines the different kinds of URI's that are known
to the |
| 470 * analysis engine. These are used to keep track of the kind of URI associated w
ith a given source. | 461 * analysis engine. These are used to keep track of the kind of URI associated w
ith a given source. |
| 471 * | 462 * |
| 472 * @coverage dart.engine.source | 463 * @coverage dart.engine.source |
| 473 */ | 464 */ |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 void setContents(Source source, String contents) { | 881 void setContents(Source source, String contents) { |
| 891 if (contents == null) { | 882 if (contents == null) { |
| 892 _contentMap.remove(source); | 883 _contentMap.remove(source); |
| 893 _stampMap.remove(source); | 884 _stampMap.remove(source); |
| 894 } else { | 885 } else { |
| 895 _contentMap[source] = contents; | 886 _contentMap[source] = contents; |
| 896 _stampMap[source] = JavaSystem.currentTimeMillis(); | 887 _stampMap[source] = JavaSystem.currentTimeMillis(); |
| 897 } | 888 } |
| 898 } | 889 } |
| 899 } | 890 } |
| OLD | NEW |