Removed old Javadocs.
git-svn-id: https://google-guice.googlecode.com/svn/trunk@267 d779f126-a31b-0410-b53b-1d3aecad763e
diff --git a/src/com/google/inject/Binder.java b/src/com/google/inject/Binder.java
index cecdca7..fd2852f 100644
--- a/src/com/google/inject/Binder.java
+++ b/src/com/google/inject/Binder.java
@@ -26,34 +26,36 @@
/**
* Collects configuration information (primarily <i>bindings</i>) which will be
- * used to create an {@link Injector}. Guice provides this object to your
- * application's {@link Module} implementors so they may each contribute their
- * own settings.
+ * used to create an {@link Injector}. Guice provides this object to your
+ * application's {@link Module}s so they may each contribute
+ * their own bindings.
*
- * The bindings contributed to an Injector are what control how the
- * Injector resolves injection requests. A binding is uniquely identified
- * within an Injector by the combination of a Java type and an <i>optional</i>
- * annotation value. It matches this key to one of:
+ * <p>The bindings contributed by {@code Module}s define how the {@code
+ * Injector} resolves dependencies. A {@link Key} consisting of a type
+ * and optional annotation uniquely identifies a binding within an {@code
+ * Injector}.
+ *
+ * <p>You may bind from a key to:
*
* <ul>
* <li>Another binding, which this binding's key is now "aliased to"
* <li>Another binding, which references a {@link Provider} for this key
- * <li>A preconstructed instance which should be used to fulfill requests for
- * this binding
- * <li>A preconstructed instance which should be used as the {@link Provider} to
- * fulfill requests for this binding
+ * <li>A preconstructed instance
+ * <li>A preconstructed instance which should be used as the {@link Provider}
+ * for this binding
* </ul>
*
- * In addition, a binding may have an associated scope specifier, such as
+ * <p>In addition, a binding may have an associated scope, such as
* {@link Scopes#SINGLETON}, and singleton bindings may specify eager or lazy
* initialization.
*
- * <p>See the user's guide appendix, "How the Injector resolves injection
- * requests" to better understand the effects of bindings.
+ * <p>See the users' guide appendix, "How the Injector resolves injection
+ * requests," to better understand binding resolution.
*
- * After an Injector has been created, its bindings may be examined using
- * methods like {@link Injector#getBinding(Key)}, but this read-only
- * {@link Binding} type is not used when <i>creating</i> the bindings.
+ * <p>After an {@code Injector} has been created, its bindings may be
+ * examined using methods like {@link Injector#getBinding(Key)}, but this
+ * read-only {@link Binding} type is not used when <i>creating</i> the
+ * bindings.
*/
public interface Binder {
diff --git a/src/com/google/inject/CreationException.java b/src/com/google/inject/CreationException.java
index fd7232b..0be323f 100644
--- a/src/com/google/inject/CreationException.java
+++ b/src/com/google/inject/CreationException.java
@@ -31,7 +31,7 @@
*
* @author crazybob@google.com (Bob Lee)
*/
-public class CreationException extends Exception {
+public class CreationException extends RuntimeException {
final List<Message> errorMessages;
diff --git a/src/com/google/inject/Guice.java b/src/com/google/inject/Guice.java
index 317586c..641245b 100644
--- a/src/com/google/inject/Guice.java
+++ b/src/com/google/inject/Guice.java
@@ -29,46 +29,49 @@
/**
* Creates an injector with no explicit bindings.
*/
- public static Injector createEmptyInjector() {
- try {
- return createInjector();
- }
- catch (CreationException e) {
- throw new AssertionError(e);
- }
+ static Injector createEmptyInjector() {
+ return createInjector();
}
/**
* Creates an injector for the given set of modules.
+ *
+ * @throws CreationException from which you can retrieve the individual error
+ * messages
*/
- public static Injector createInjector(Module... modules)
- throws CreationException {
+ public static Injector createInjector(Module... modules) {
return createInjector(Arrays.asList(modules));
}
/**
* Creates an injector for the given set of modules.
+ *
+ * @throws CreationException from which you can retrieve the individual error
+ * messages
*/
- public static Injector createInjector(Iterable<Module> modules)
- throws CreationException {
+ public static Injector createInjector(Iterable<Module> modules) {
return createInjector(Stage.DEVELOPMENT, modules);
}
/**
* Creates an injector for the given set of modules, in a given development
* stage.
+ *
+ * @throws CreationException from which you can retrieve the individual error
+ * messages.
*/
- public static Injector createInjector(Stage stage, Module... modules)
- throws CreationException {
+ public static Injector createInjector(Stage stage, Module... modules) {
return createInjector(stage, Arrays.asList(modules));
}
/**
* Creates an injector for the given set of modules, in a given development
* stage.
+ *
+ * @throws CreationException from which you can retrieve the individual error
+ * messages.
*/
- public static Injector createInjector(Stage stage, Iterable<Module> modules)
- throws CreationException {
+ public static Injector createInjector(Stage stage, Iterable<Module> modules) {
BinderImpl binder = new BinderImpl(stage);
for (Module module : modules) {
binder.install(module);
diff --git a/src/com/google/inject/Injector.java b/src/com/google/inject/Injector.java
index 8ef7d8f..20d45a4 100644
--- a/src/com/google/inject/Injector.java
+++ b/src/com/google/inject/Injector.java
@@ -20,12 +20,12 @@
import java.util.Map;
/**
- * Fulfills requests for the object instances that make up your
- * application, always ensuring that these instances are properly injected
- * before they are returned. The Injector is the heart of the Guice framework,
- * although you don't typically interact with it directly very often. This
- * "behind-the-scenes" operation is what distinguishes the Dependency Injection
- * pattern from its cousin, Service Locator.
+ * Fulfills requests for the object instances that make up your application,
+ * always ensuring that these instances are properly injected before they are
+ * returned. The {@code Injector} is the heart of the Guice framework,
+ * although you don't typically interact with it directly very often. This
+ * "behind-the-scenes" operation is what distinguishes the dependency
+ * injection pattern from its cousin, service locator.
*
* <p>The {@code Injector} API has a few additional features: it allows
* pre-constructed instances to have their fields and methods injected and
diff --git a/src/com/google/inject/Module.java b/src/com/google/inject/Module.java
index 8894955..03becf2 100644
--- a/src/com/google/inject/Module.java
+++ b/src/com/google/inject/Module.java
@@ -19,8 +19,8 @@
/**
* A module contributes configuration information, typically interface
* bindings, which will be used to create an {@link Injector}. A guice-based
- * application is ultimately composed of little more than a set of Modules
- * and some bootstrapping code.
+ * application is ultimately composed of little more than a set of
+ * {@code Module}s and some bootstrapping code.
*
* <p>Your Module classes can use a more streamlined syntax by extending
* {@link AbstractModule} rather than implementing this interface directly.
diff --git a/src/com/google/inject/Scope.java b/src/com/google/inject/Scope.java
index 59510b3..785d8a3 100644
--- a/src/com/google/inject/Scope.java
+++ b/src/com/google/inject/Scope.java
@@ -18,11 +18,12 @@
/**
* A scope is a level of visibility that instances provided by Guice may have.
- * By default, an instance created by the {@link Injector} has <i>no scope</i>,
- * meaning it has no visibility -- the Injector creates it, injects it once
- * into the class that required it, then immediately forgets it. Associating a
- * scope with a particular binding allows the created instance to be
- * "remembered" and possibly used again for other injections.
+ * By default, an instance created by the {@link Injector} has <i>no
+ * scope</i>, meaning it has no state from the framework's perspective -- the
+ * {@code Injector} creates it, injects it once into the class that required it,
+ * and then immediately forgets it. Associating a scope with a particular binding
+ * allows the created instance to be "remembered" and possibly used again for
+ * other injections.
*
* @see Scopes#SINGLETON
*