| 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.sdk; | 3 library engine.sdk; |
| 4 import 'java_core.dart'; | 4 import 'java_core.dart'; |
| 5 import 'java_engine.dart'; | 5 import 'java_engine.dart'; |
| 6 import 'source.dart' show ContentCache, Source, UriKind; | 6 import 'source.dart' show ContentCache, Source, UriKind; |
| 7 import 'engine.dart' show AnalysisContext; | 7 import 'engine.dart' show AnalysisContext; |
| 8 /** | 8 /** |
| 9 * Represents a single library in the SDK | 9 * Represents a single library in the SDK |
| 10 */ | 10 */ |
| 11 abstract class SdkLibrary { | 11 abstract class SdkLibrary { |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * Return the name of the category containing the library. | 14 * Return the name of the category containing the library. |
| 15 * |
| 15 * @return the name of the category containing the library | 16 * @return the name of the category containing the library |
| 16 */ | 17 */ |
| 17 String get category; | 18 String get category; |
| 18 | 19 |
| 19 /** | 20 /** |
| 20 * Return the path to the file defining the library. The path is relative to t
he `lib`directory within the SDK. | 21 * Return the path to the file defining the library. The path is relative to t
he `lib` |
| 22 * directory within the SDK. |
| 23 * |
| 21 * @return the path to the file defining the library | 24 * @return the path to the file defining the library |
| 22 */ | 25 */ |
| 23 String get path; | 26 String get path; |
| 24 | 27 |
| 25 /** | 28 /** |
| 26 * Return the short name of the library. This is the name used after `dart:` i
n a URI. | 29 * Return the short name of the library. This is the name used after `dart:` i
n a URI. |
| 30 * |
| 27 * @return the short name of the library | 31 * @return the short name of the library |
| 28 */ | 32 */ |
| 29 String get shortName; | 33 String get shortName; |
| 30 | 34 |
| 31 /** | 35 /** |
| 32 * Return `true` if this library can be compiled to JavaScript by dart2js. | 36 * Return `true` if this library can be compiled to JavaScript by dart2js. |
| 37 * |
| 33 * @return `true` if this library can be compiled to JavaScript by dart2js | 38 * @return `true` if this library can be compiled to JavaScript by dart2js |
| 34 */ | 39 */ |
| 35 bool get isDart2JsLibrary; | 40 bool get isDart2JsLibrary; |
| 36 | 41 |
| 37 /** | 42 /** |
| 38 * Return `true` if the library is documented. | 43 * Return `true` if the library is documented. |
| 44 * |
| 39 * @return `true` if the library is documented | 45 * @return `true` if the library is documented |
| 40 */ | 46 */ |
| 41 bool get isDocumented; | 47 bool get isDocumented; |
| 42 | 48 |
| 43 /** | 49 /** |
| 44 * Return `true` if the library is an implementation library. | 50 * Return `true` if the library is an implementation library. |
| 51 * |
| 45 * @return `true` if the library is an implementation library | 52 * @return `true` if the library is an implementation library |
| 46 */ | 53 */ |
| 47 bool get isImplementation; | 54 bool get isImplementation; |
| 48 | 55 |
| 49 /** | 56 /** |
| 50 * Return `true` if library is internal can be used only by other SDK librarie
s. | 57 * Return `true` if library is internal can be used only by other SDK librarie
s. |
| 58 * |
| 51 * @return `true` if library is internal can be used only by other SDK librari
es | 59 * @return `true` if library is internal can be used only by other SDK librari
es |
| 52 */ | 60 */ |
| 53 bool get isInternal; | 61 bool get isInternal; |
| 54 | 62 |
| 55 /** | 63 /** |
| 56 * Return `true` if library can be used for both client and server. | 64 * Return `true` if library can be used for both client and server. |
| 65 * |
| 57 * @return `true` if this library can be used for both client and server. | 66 * @return `true` if this library can be used for both client and server. |
| 58 */ | 67 */ |
| 59 bool get isShared; | 68 bool get isShared; |
| 60 | 69 |
| 61 /** | 70 /** |
| 62 * Return `true` if this library can be run on the VM. | 71 * Return `true` if this library can be run on the VM. |
| 72 * |
| 63 * @return `true` if this library can be run on the VM | 73 * @return `true` if this library can be run on the VM |
| 64 */ | 74 */ |
| 65 bool get isVmLibrary; | 75 bool get isVmLibrary; |
| 66 } | 76 } |
| 67 /** | 77 /** |
| 68 * Instances of the class `SdkLibrary` represent the information known about a s
ingle library | 78 * Instances of the class `SdkLibrary` represent the information known about a s
ingle library |
| 69 * within the SDK. | 79 * within the SDK. |
| 80 * |
| 70 * @coverage dart.engine.sdk | 81 * @coverage dart.engine.sdk |
| 71 */ | 82 */ |
| 72 class SdkLibraryImpl implements SdkLibrary { | 83 class SdkLibraryImpl implements SdkLibrary { |
| 73 | 84 |
| 74 /** | 85 /** |
| 75 * The short name of the library. This is the name used after `dart:` in a URI
. | 86 * The short name of the library. This is the name used after `dart:` in a URI
. |
| 76 */ | 87 */ |
| 77 String _shortName = null; | 88 String _shortName = null; |
| 78 | 89 |
| 79 /** | 90 /** |
| (...skipping 30 matching lines...) Expand all Loading... |
| 110 static int DART2JS_PLATFORM = 1; | 121 static int DART2JS_PLATFORM = 1; |
| 111 | 122 |
| 112 /** | 123 /** |
| 113 * The bit mask used to access the bit representing the flag indicating whethe
r a library is | 124 * The bit mask used to access the bit representing the flag indicating whethe
r a library is |
| 114 * intended to work on the VM platform. | 125 * intended to work on the VM platform. |
| 115 */ | 126 */ |
| 116 static int VM_PLATFORM = 2; | 127 static int VM_PLATFORM = 2; |
| 117 | 128 |
| 118 /** | 129 /** |
| 119 * Initialize a newly created library to represent the library with the given
name. | 130 * Initialize a newly created library to represent the library with the given
name. |
| 131 * |
| 120 * @param name the short name of the library | 132 * @param name the short name of the library |
| 121 */ | 133 */ |
| 122 SdkLibraryImpl(String name) { | 134 SdkLibraryImpl(String name) { |
| 123 this._shortName = name; | 135 this._shortName = name; |
| 124 } | 136 } |
| 125 String get category => _category; | 137 String get category => _category; |
| 126 String get path => _path; | 138 String get path => _path; |
| 127 String get shortName => _shortName; | 139 String get shortName => _shortName; |
| 128 bool get isDart2JsLibrary => (_platforms & DART2JS_PLATFORM) != 0; | 140 bool get isDart2JsLibrary => (_platforms & DART2JS_PLATFORM) != 0; |
| 129 bool get isDocumented => _documented; | 141 bool get isDocumented => _documented; |
| 130 bool get isImplementation => _implementation; | 142 bool get isImplementation => _implementation; |
| 131 bool get isInternal => "Internal" == _category; | 143 bool get isInternal => "Internal" == _category; |
| 132 | 144 |
| 133 /** | 145 /** |
| 134 * Return `true` if library can be used for both client and server | 146 * Return `true` if library can be used for both client and server |
| 135 */ | 147 */ |
| 136 bool get isShared => _category == "Shared"; | 148 bool get isShared => _category == "Shared"; |
| 137 | 149 |
| 138 /** | 150 /** |
| 139 * Return `true` if this library can be run on the VM. | 151 * Return `true` if this library can be run on the VM. |
| 152 * |
| 140 * @return `true` if this library can be run on the VM | 153 * @return `true` if this library can be run on the VM |
| 141 */ | 154 */ |
| 142 bool get isVmLibrary => (_platforms & VM_PLATFORM) != 0; | 155 bool get isVmLibrary => (_platforms & VM_PLATFORM) != 0; |
| 143 | 156 |
| 144 /** | 157 /** |
| 145 * Set the name of the category containing the library to the given name. | 158 * Set the name of the category containing the library to the given name. |
| 159 * |
| 146 * @param category the name of the category containing the library | 160 * @param category the name of the category containing the library |
| 147 */ | 161 */ |
| 148 void set category(String category2) { | 162 void set category(String category2) { |
| 149 this._category = category2; | 163 this._category = category2; |
| 150 } | 164 } |
| 151 | 165 |
| 152 /** | 166 /** |
| 153 * Record that this library can be compiled to JavaScript by dart2js. | 167 * Record that this library can be compiled to JavaScript by dart2js. |
| 154 */ | 168 */ |
| 155 void setDart2JsLibrary() { | 169 void setDart2JsLibrary() { |
| 156 _platforms |= DART2JS_PLATFORM; | 170 _platforms |= DART2JS_PLATFORM; |
| 157 } | 171 } |
| 158 | 172 |
| 159 /** | 173 /** |
| 160 * Set whether the library is documented to match the given value. | 174 * Set whether the library is documented to match the given value. |
| 175 * |
| 161 * @param documented `true` if the library is documented | 176 * @param documented `true` if the library is documented |
| 162 */ | 177 */ |
| 163 void set documented(bool documented2) { | 178 void set documented(bool documented2) { |
| 164 this._documented = documented2; | 179 this._documented = documented2; |
| 165 } | 180 } |
| 166 | 181 |
| 167 /** | 182 /** |
| 168 * Set whether the library is an implementation library to match the given val
ue. | 183 * Set whether the library is an implementation library to match the given val
ue. |
| 184 * |
| 169 * @param implementation `true` if the library is an implementation library | 185 * @param implementation `true` if the library is an implementation library |
| 170 */ | 186 */ |
| 171 void set implementation(bool implementation2) { | 187 void set implementation(bool implementation2) { |
| 172 this._implementation = implementation2; | 188 this._implementation = implementation2; |
| 173 } | 189 } |
| 174 | 190 |
| 175 /** | 191 /** |
| 176 * Set the path to the file defining the library to the given path. The path i
s relative to the`lib` directory within the SDK. | 192 * Set the path to the file defining the library to the given path. The path i
s relative to the |
| 193 * `lib` directory within the SDK. |
| 194 * |
| 177 * @param path the path to the file defining the library | 195 * @param path the path to the file defining the library |
| 178 */ | 196 */ |
| 179 void set path(String path2) { | 197 void set path(String path2) { |
| 180 this._path = path2; | 198 this._path = path2; |
| 181 } | 199 } |
| 182 | 200 |
| 183 /** | 201 /** |
| 184 * Record that this library can be run on the VM. | 202 * Record that this library can be run on the VM. |
| 185 */ | 203 */ |
| 186 void setVmLibrary() { | 204 void setVmLibrary() { |
| 187 _platforms |= VM_PLATFORM; | 205 _platforms |= VM_PLATFORM; |
| 188 } | 206 } |
| 189 } | 207 } |
| 190 /** | 208 /** |
| 191 * Instances of the class `LibraryMap` map Dart library URI's to the [SdkLibrary
Impllibrary]. | 209 * Instances of the class `LibraryMap` map Dart library URI's to the [SdkLibrary
Impl |
| 210 ]. |
| 211 * |
| 192 * @coverage dart.engine.sdk | 212 * @coverage dart.engine.sdk |
| 193 */ | 213 */ |
| 194 class LibraryMap { | 214 class LibraryMap { |
| 195 | 215 |
| 196 /** | 216 /** |
| 197 * A table mapping Dart library URI's to the library. | 217 * A table mapping Dart library URI's to the library. |
| 198 */ | 218 */ |
| 199 Map<String, SdkLibraryImpl> _libraryMap = new Map<String, SdkLibraryImpl>(); | 219 Map<String, SdkLibraryImpl> _libraryMap = new Map<String, SdkLibraryImpl>(); |
| 200 | 220 |
| 201 /** | 221 /** |
| 202 * Return the library with the given URI, or `null` if the URI does not map to
a library. | 222 * Return the library with the given URI, or `null` if the URI does not map to
a library. |
| 223 * |
| 203 * @param dartUri the URI of the library to be returned | 224 * @param dartUri the URI of the library to be returned |
| 204 * @return the library with the given URI | 225 * @return the library with the given URI |
| 205 */ | 226 */ |
| 206 SdkLibrary getLibrary(String dartUri) => _libraryMap[dartUri]; | 227 SdkLibrary getLibrary(String dartUri) => _libraryMap[dartUri]; |
| 207 | 228 |
| 208 /** | 229 /** |
| 209 * Return an array containing all the sdk libraries [SdkLibraryImpl] in the ma
pping | 230 * Return an array containing all the sdk libraries [SdkLibraryImpl] in the ma
pping |
| 231 * |
| 210 * @return the sdk libraries in the mapping | 232 * @return the sdk libraries in the mapping |
| 211 */ | 233 */ |
| 212 List<SdkLibrary> get sdkLibraries => new List.from(_libraryMap.values); | 234 List<SdkLibrary> get sdkLibraries => new List.from(_libraryMap.values); |
| 213 | 235 |
| 214 /** | 236 /** |
| 215 * Return an array containing the library URI's for which a mapping is availab
le. | 237 * Return an array containing the library URI's for which a mapping is availab
le. |
| 238 * |
| 216 * @return the library URI's for which a mapping is available | 239 * @return the library URI's for which a mapping is available |
| 217 */ | 240 */ |
| 218 List<String> get uris => new List.from(_libraryMap.keys.toSet()); | 241 List<String> get uris => new List.from(_libraryMap.keys.toSet()); |
| 219 | 242 |
| 220 /** | 243 /** |
| 221 * Return the library with the given URI, or `null` if the URI does not map to
a library. | 244 * Return the library with the given URI, or `null` if the URI does not map to
a library. |
| 245 * |
| 222 * @param dartUri the URI of the library to be returned | 246 * @param dartUri the URI of the library to be returned |
| 223 * @param library the library with the given URI | 247 * @param library the library with the given URI |
| 224 */ | 248 */ |
| 225 void setLibrary(String dartUri, SdkLibraryImpl library) { | 249 void setLibrary(String dartUri, SdkLibraryImpl library) { |
| 226 _libraryMap[dartUri] = library; | 250 _libraryMap[dartUri] = library; |
| 227 } | 251 } |
| 228 | 252 |
| 229 /** | 253 /** |
| 230 * Return the number of library URI's for which a mapping is available. | 254 * Return the number of library URI's for which a mapping is available. |
| 255 * |
| 231 * @return the number of library URI's for which a mapping is available | 256 * @return the number of library URI's for which a mapping is available |
| 232 */ | 257 */ |
| 233 int size() => _libraryMap.length; | 258 int size() => _libraryMap.length; |
| 234 } | 259 } |
| 235 /** | 260 /** |
| 236 * Instances of the class `DartSdk` represent a Dart SDK installed in a specifie
d location. | 261 * Instances of the class `DartSdk` represent a Dart SDK installed in a specifie
d location. |
| 262 * |
| 237 * @coverage dart.engine.sdk | 263 * @coverage dart.engine.sdk |
| 238 */ | 264 */ |
| 239 abstract class DartSdk { | 265 abstract class DartSdk { |
| 240 | 266 |
| 241 /** | 267 /** |
| 242 * The short name of the dart SDK core library. | 268 * The short name of the dart SDK core library. |
| 243 */ | 269 */ |
| 244 static final String DART_CORE = "dart:core"; | 270 static final String DART_CORE = "dart:core"; |
| 245 | 271 |
| 246 /** | 272 /** |
| 247 * The short name of the dart SDK html library. | 273 * The short name of the dart SDK html library. |
| 248 */ | 274 */ |
| 249 static final String DART_HTML = "dart:html"; | 275 static final String DART_HTML = "dart:html"; |
| 250 | 276 |
| 251 /** | 277 /** |
| 252 * The version number that is returned when the real version number could not
be determined. | 278 * The version number that is returned when the real version number could not
be determined. |
| 253 */ | 279 */ |
| 254 static final String DEFAULT_VERSION = "0"; | 280 static final String DEFAULT_VERSION = "0"; |
| 255 | 281 |
| 256 /** | 282 /** |
| 257 * Return the source representing the file with the given URI. | 283 * Return the source representing the file with the given URI. |
| 284 * |
| 258 * @param contentCache the content cache used to access the contents of the ma
pped source | 285 * @param contentCache the content cache used to access the contents of the ma
pped source |
| 259 * @param kind the kind of URI that was originally resolved in order to produc
e an encoding with | 286 * @param kind the kind of URI that was originally resolved in order to produc
e an encoding with |
| 260 * the given URI | 287 * the given URI |
| 261 * @param uri the URI of the file to be returned | 288 * @param uri the URI of the file to be returned |
| 262 * @return the source representing the specified file | 289 * @return the source representing the specified file |
| 263 */ | 290 */ |
| 264 Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri); | 291 Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri); |
| 265 | 292 |
| 266 /** | 293 /** |
| 267 * Return the [AnalysisContext] used for all of the sources in this [DartSdk]. | 294 * Return the [AnalysisContext] used for all of the sources in this [DartSdk]. |
| 295 * |
| 268 * @return the [AnalysisContext] used for all of the sources in this [DartSdk] | 296 * @return the [AnalysisContext] used for all of the sources in this [DartSdk] |
| 269 */ | 297 */ |
| 270 AnalysisContext get context; | 298 AnalysisContext get context; |
| 271 | 299 |
| 272 /** | 300 /** |
| 273 * Return an array containing all of the libraries defined in this SDK. | 301 * Return an array containing all of the libraries defined in this SDK. |
| 302 * |
| 274 * @return the libraries defined in this SDK | 303 * @return the libraries defined in this SDK |
| 275 */ | 304 */ |
| 276 List<SdkLibrary> get sdkLibraries; | 305 List<SdkLibrary> get sdkLibraries; |
| 277 | 306 |
| 278 /** | 307 /** |
| 279 * Return the library representing the library with the given `dart:` URI, or
`null`if the given URI does not denote a library in this SDK. | 308 * Return the library representing the library with the given `dart:` URI, or
`null` |
| 309 * if the given URI does not denote a library in this SDK. |
| 310 * |
| 280 * @param dartUri the URI of the library to be returned | 311 * @param dartUri the URI of the library to be returned |
| 281 * @return the SDK library object | 312 * @return the SDK library object |
| 282 */ | 313 */ |
| 283 SdkLibrary getSdkLibrary(String dartUri); | 314 SdkLibrary getSdkLibrary(String dartUri); |
| 284 | 315 |
| 285 /** | 316 /** |
| 286 * Return the revision number of this SDK, or `"0"` if the revision number can
not be | 317 * Return the revision number of this SDK, or `"0"` if the revision number can
not be |
| 287 * discovered. | 318 * discovered. |
| 319 * |
| 288 * @return the revision number of this SDK | 320 * @return the revision number of this SDK |
| 289 */ | 321 */ |
| 290 String get sdkVersion; | 322 String get sdkVersion; |
| 291 | 323 |
| 292 /** | 324 /** |
| 293 * Return an array containing the library URI's for the libraries defined in t
his SDK. | 325 * Return an array containing the library URI's for the libraries defined in t
his SDK. |
| 326 * |
| 294 * @return the library URI's for the libraries defined in this SDK | 327 * @return the library URI's for the libraries defined in this SDK |
| 295 */ | 328 */ |
| 296 List<String> get uris; | 329 List<String> get uris; |
| 297 | 330 |
| 298 /** | 331 /** |
| 299 * Return the source representing the library with the given `dart:` URI, or `
null` if | 332 * Return the source representing the library with the given `dart:` URI, or `
null` if |
| 300 * the given URI does not denote a library in this SDK. | 333 * the given URI does not denote a library in this SDK. |
| 334 * |
| 301 * @param contentCache the content cache used to access the contents of the ma
pped source | 335 * @param contentCache the content cache used to access the contents of the ma
pped source |
| 302 * @param dartUri the URI of the library to be returned | 336 * @param dartUri the URI of the library to be returned |
| 303 * @return the source representing the specified library | 337 * @return the source representing the specified library |
| 304 */ | 338 */ |
| 305 Source mapDartUri(ContentCache contentCache, String dartUri); | 339 Source mapDartUri(ContentCache contentCache, String dartUri); |
| 306 } | 340 } |
| OLD | NEW |