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