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