Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: pkg/analyzer_experimental/lib/src/generated/source_io.dart

Issue 12803014: New Analysis Engine translation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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';
(...skipping 19 matching lines...) Expand all
30 * A flag indicating whether this source is in one of the system libraries. 30 * A flag indicating whether this source is in one of the system libraries.
31 */ 31 */
32 bool _inSystemLibrary = false; 32 bool _inSystemLibrary = false;
33 /** 33 /**
34 * Initialize a newly created source object. The source object is assumed to n ot be in a system 34 * Initialize a newly created source object. The source object is assumed to n ot be in a system
35 * library. 35 * library.
36 * @param factory the source factory that created this source 36 * @param factory the source factory that created this source
37 * @param file the file represented by this source 37 * @param file the file represented by this source
38 */ 38 */
39 FileBasedSource.con1(SourceFactory factory, JavaFile file) { 39 FileBasedSource.con1(SourceFactory factory, JavaFile file) {
40 _jtd_constructor_298_impl(factory, file); 40 _jtd_constructor_302_impl(factory, file);
41 } 41 }
42 _jtd_constructor_298_impl(SourceFactory factory, JavaFile file) { 42 _jtd_constructor_302_impl(SourceFactory factory, JavaFile file) {
43 _jtd_constructor_299_impl(factory, file, false); 43 _jtd_constructor_303_impl(factory, file, false);
44 } 44 }
45 /** 45 /**
46 * Initialize a newly created source object. 46 * Initialize a newly created source object.
47 * @param factory the source factory that created this source 47 * @param factory the source factory that created this source
48 * @param file the file represented by this source 48 * @param file the file represented by this source
49 * @param inSystemLibrary {@code true} if this source is in one of the system libraries 49 * @param inSystemLibrary {@code true} if this source is in one of the system libraries
50 */ 50 */
51 FileBasedSource.con2(SourceFactory factory2, JavaFile file3, bool inSystemLibr ary2) { 51 FileBasedSource.con2(SourceFactory factory2, JavaFile file3, bool inSystemLibr ary2) {
52 _jtd_constructor_299_impl(factory2, file3, inSystemLibrary2); 52 _jtd_constructor_303_impl(factory2, file3, inSystemLibrary2);
53 } 53 }
54 _jtd_constructor_299_impl(SourceFactory factory2, JavaFile file3, bool inSyste mLibrary2) { 54 _jtd_constructor_303_impl(SourceFactory factory2, JavaFile file3, bool inSyste mLibrary2) {
55 this._factory = factory2; 55 this._factory = factory2;
56 this._file = file3; 56 this._file = file3;
57 this._inSystemLibrary = inSystemLibrary2; 57 this._inSystemLibrary = inSystemLibrary2;
58 } 58 }
59 bool operator ==(Object object) => object != null && identical(this.runtimeTyp e, object.runtimeType) && _file == ((object as FileBasedSource))._file; 59 bool operator ==(Object object) => object != null && identical(this.runtimeTyp e, object.runtimeType) && _file == ((object as FileBasedSource))._file;
60 bool exists() => _file.exists(); 60 bool exists() => _factory.getContents(this) != null || (_file.exists() && !_fi le.isDirectory());
61 AnalysisContext get context => _factory.context;
62 void getContents(Source_ContentReceiver receiver) { 61 void getContents(Source_ContentReceiver receiver) {
63 { 62 {
64 String contents = _factory.getContents(this); 63 String contents = _factory.getContents(this);
65 if (contents != null) { 64 if (contents != null) {
66 receiver.accept2(contents); 65 receiver.accept2(contents);
67 return; 66 return;
68 } 67 }
69 } 68 }
70 receiver.accept2(_file.readAsStringSync()); 69 receiver.accept2(_file.readAsStringSync());
71 } 70 }
71 AnalysisContext get context => _factory.context;
72 String get encoding => _file.toURI().toString(); 72 String get encoding => _file.toURI().toString();
73 String get fullName => _file.getAbsolutePath(); 73 String get fullName => _file.getAbsolutePath();
74 int get modificationStamp { 74 int get modificationStamp {
75 int stamp = _factory.getModificationStamp(this); 75 int stamp = _factory.getModificationStamp(this);
76 if (stamp != null) { 76 if (stamp != null) {
77 return stamp; 77 return stamp;
78 } 78 }
79 return _file.lastModified(); 79 return _file.lastModified();
80 } 80 }
81 String get shortName => _file.getName(); 81 String get shortName => _file.getName();
82 int get hashCode => _file.hashCode; 82 int get hashCode => _file.hashCode;
83 bool isInSystemLibrary() => _inSystemLibrary; 83 bool isInSystemLibrary() => _inSystemLibrary;
84 Source resolve(String uri) => _factory.resolveUri(this, uri); 84 Source resolve(String uri) => _factory.resolveUri(this, uri);
85 Source resolveRelative(Uri containedUri) { 85 Source resolveRelative(Uri containedUri) {
86 try { 86 try {
87 Uri resolvedUri = file.toURI().resolveUri(containedUri); 87 Uri resolvedUri = file.toURI().resolveUri(containedUri);
88 return new FileBasedSource.con1(_factory, new JavaFile.fromUri(resolvedUri )); 88 return new FileBasedSource.con1(_factory, new JavaFile.fromUri(resolvedUri ));
89 } on JavaException catch (exception) { 89 } catch (exception) {
90 } 90 }
91 return null; 91 return null;
92 } 92 }
93 String toString() { 93 String toString() {
94 if (_file == null) { 94 if (_file == null) {
95 return "<unknown source>"; 95 return "<unknown source>";
96 } 96 }
97 return _file.getAbsolutePath(); 97 return _file.getAbsolutePath();
98 } 98 }
99 /** 99 /**
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 /** 214 /**
215 * The container's path (not {@code null}). 215 * The container's path (not {@code null}).
216 */ 216 */
217 String _path; 217 String _path;
218 /** 218 /**
219 * 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, 219 * 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,
220 * fully equivalent to {@link DirectoryBasedSourceContainer#DirectoryBasedSour ceContainer(String)}. 220 * fully equivalent to {@link DirectoryBasedSourceContainer#DirectoryBasedSour ceContainer(String)}.
221 * @param directory the directory (not {@code null}) 221 * @param directory the directory (not {@code null})
222 */ 222 */
223 DirectoryBasedSourceContainer.con1(JavaFile directory) { 223 DirectoryBasedSourceContainer.con1(JavaFile directory) {
224 _jtd_constructor_296_impl(directory); 224 _jtd_constructor_300_impl(directory);
225 } 225 }
226 _jtd_constructor_296_impl(JavaFile directory) { 226 _jtd_constructor_300_impl(JavaFile directory) {
227 _jtd_constructor_297_impl(directory.getPath()); 227 _jtd_constructor_301_impl(directory.getPath());
228 } 228 }
229 /** 229 /**
230 * Construct a container representing the specified path and containing any so urces whose{@link Source#getFullName()} starts with the specified path. 230 * Construct a container representing the specified path and containing any so urces whose{@link Source#getFullName()} starts with the specified path.
231 * @param path the path (not {@code null} and not empty) 231 * @param path the path (not {@code null} and not empty)
232 */ 232 */
233 DirectoryBasedSourceContainer.con2(String path3) { 233 DirectoryBasedSourceContainer.con2(String path3) {
234 _jtd_constructor_297_impl(path3); 234 _jtd_constructor_301_impl(path3);
235 } 235 }
236 _jtd_constructor_297_impl(String path3) { 236 _jtd_constructor_301_impl(String path3) {
237 this._path = appendFileSeparator(path3); 237 this._path = appendFileSeparator(path3);
238 } 238 }
239 bool contains(Source source) => source.fullName.startsWith(_path); 239 bool contains(Source source) => source.fullName.startsWith(_path);
240 bool operator ==(Object obj) => (obj is DirectoryBasedSourceContainer) && ((ob j as DirectoryBasedSourceContainer)).path == path; 240 bool operator ==(Object obj) => (obj is DirectoryBasedSourceContainer) && ((ob j as DirectoryBasedSourceContainer)).path == path;
241 /** 241 /**
242 * Answer the receiver's path, used to determine if a source is contained in t he receiver. 242 * Answer the receiver's path, used to determine if a source is contained in t he receiver.
243 * @return the path (not {@code null}, not empty) 243 * @return the path (not {@code null}, not empty)
244 */ 244 */
245 String get path => _path; 245 String get path => _path;
246 int get hashCode => _path.hashCode; 246 int get hashCode => _path.hashCode;
(...skipping 19 matching lines...) Expand all
266 */ 266 */
267 FileUriResolver() : super() { 267 FileUriResolver() : super() {
268 } 268 }
269 Source resolveAbsolute(SourceFactory factory, Uri uri) { 269 Source resolveAbsolute(SourceFactory factory, Uri uri) {
270 if (!isFileUri(uri)) { 270 if (!isFileUri(uri)) {
271 return null; 271 return null;
272 } 272 }
273 return new FileBasedSource.con1(factory, new JavaFile.fromUri(uri)); 273 return new FileBasedSource.con1(factory, new JavaFile.fromUri(uri));
274 } 274 }
275 } 275 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/source.dart ('k') | pkg/analyzer_experimental/test/generated/ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698