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

Unified Diff: third_party/pkg/di/lib/src/injector.dart

Issue 257423008: Update all Angular libs (run update_all.sh). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/pkg/di/lib/src/errors.dart ('k') | third_party/pkg/di/lib/src/injector_delagate.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/di/lib/src/injector.dart
diff --git a/third_party/pkg/di/lib/src/injector.dart b/third_party/pkg/di/lib/src/injector.dart
new file mode 100644
index 0000000000000000000000000000000000000000..80d39b1ac9b51440e0038f4900fc0039732735dc
--- /dev/null
+++ b/third_party/pkg/di/lib/src/injector.dart
@@ -0,0 +1,66 @@
+part of di;
+
+abstract class Injector {
+ /**
+ * Name of the injector or null of none is given.
+ */
+ String get name;
+
+ /**
+ * The parent injector or null if root.
+ */
+ Injector get parent;
+
+ /**
+ * The root injector.
+ */
+ Injector get root;
+
+ /**
+ * List of all types which the injector can return
+ */
+ Set<Type> get types;
+
+ /**
+ * Indicates whether injector allows implicit injection -- resolving types
+ * that were not explicitly bound in the module(s).
+ */
+ bool get allowImplicitInjection;
+
+ /**
+ * Get an instance for given token ([Type]).
+ *
+ * If the injector already has an instance for this token, it returns this
+ * instance. Otherwise, injector resolves all its dependencies, instantiates
+ * new instance and returns this instance.
+ *
+ * If there is no binding for given token, injector asks parent injector.
+ *
+ * If there is no parent injector, an implicit binding is used. That is,
+ * the token ([Type]) is instantiated.
+ */
+ dynamic get(Type type, [Type annotation]);
+
+ /**
+ * Get an instance for given key ([Key]).
+ *
+ * If the injector already has an instance for this key, it returns this
+ * instance. Otherwise, injector resolves all its dependencies, instantiates
+ * new instance and returns this instance.
+ *
+ * If there is no binding for given key, injector asks parent injector.
+ */
+ dynamic getByKey(Key key);
+
+ /**
+ * Create a child injector.
+ *
+ * Child injector can override any bindings by adding additional modules.
+ *
+ * It also accepts a list of tokens that a new instance should be forced.
+ * That means, even if some parent injector already has an instance for this
+ * token, there will be a new instance created in the child injector.
+ */
+ Injector createChild(List<Module> modules,
+ {List forceNewInstances, String name});
+}
« no previous file with comments | « third_party/pkg/di/lib/src/errors.dart ('k') | third_party/pkg/di/lib/src/injector_delagate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698