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

Side by Side Diff: initialize/lib/src/initializer.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « initialize/lib/src/initialize_tracker.dart ('k') | initialize/lib/src/mirror_loader.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4 part of initialize;
5
6 /// Implement this class to create your own initializer.
7 ///
8 /// Hello world example:
9 ///
10 /// class Print implements Initializer<Type> {
11 /// final String message;
12 /// const Print(this.message);
13 ///
14 /// @override
15 /// initialize(Type t) => print('$t says `$message`');
16 /// }
17 ///
18 /// @Print('hello world!')
19 /// class Foo {}
20 ///
21 /// Call [run] from your main and this will print 'Foo says `hello world!`'
22 ///
23 abstract class Initializer<T> {
24 dynamic initialize(T target);
25 }
26
27 /// Typedef for a custom filter function.
28 typedef bool InitializerFilter(Initializer initializer);
29
30 /// When annotating libraries, this is passed to the initializer.
31 class LibraryIdentifier {
32 // The qualified name of the library.
33 final Symbol name;
34
35 // The package this library lives in. May be null if its the same as the root
36 // package.
37 final String package;
38
39 // The path to the library.
40 final String path;
41
42 const LibraryIdentifier(this.name, this.package, this.path);
43
44 bool operator ==(LibraryIdentifier other) =>
45 name == other.name && package == other.package && path == other.path;
46
47 String toString() => '$name: $package:$path';
48 }
OLDNEW
« no previous file with comments | « initialize/lib/src/initialize_tracker.dart ('k') | initialize/lib/src/mirror_loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698