Added spring package to Javadocs. Made minor updates to various Javadocs.
git-svn-id: https://google-guice.googlecode.com/svn/trunk@259 d779f126-a31b-0410-b53b-1d3aecad763e
diff --git a/build.properties b/build.properties
index 92d4f20..d5e9dc7 100644
--- a/build.properties
+++ b/build.properties
@@ -2,8 +2,10 @@
src.dir=src
test.dir=test
servlet.src.dir=servlet/src
+spring.src.dir=spring/src
build.dir=build
javadoc.packagenames=com.google.inject,com.google.inject.spi,\
com.google.inject.matcher,com.google.inject.servlet,com.google.inject.name,\
- com.google.inject.tools.jmx,com.google.inject.binder,com.google.inject.jndi
+ com.google.inject.tools.jmx,com.google.inject.binder,com.google.inject.jndi,\
+ com.google.inject.spring
test.class=com.google.inject.AllTests
diff --git a/build.xml b/build.xml
index 919cc80..d5d0168 100644
--- a/build.xml
+++ b/build.xml
@@ -85,6 +85,7 @@
<sourcepath>
<pathelement location="${src.dir}"/>
<pathelement location="${servlet.src.dir}"/>
+ <pathelement location="${spring.src.dir}"/>
</sourcepath>
<classpath refid="compile.classpath"/>
<classpath>
@@ -92,6 +93,7 @@
</classpath>
<link href="http://aopalliance.sourceforge.net/doc"/>
<link href="http://java.sun.com/javase/6/docs/api"/>
+ <link href="http://www.springframework.org/docs/api/"/>
</javadoc>
</target>
diff --git a/spring/src/com/google/inject/spring/package-info.java b/spring/src/com/google/inject/spring/package-info.java
new file mode 100644
index 0000000..f63a9f4
--- /dev/null
+++ b/spring/src/com/google/inject/spring/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2006 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Spring integration
+ */
+package com.google.inject.spring;
\ No newline at end of file
diff --git a/src/com/google/inject/Binding.java b/src/com/google/inject/Binding.java
index 4790e6f..23bdba3 100644
--- a/src/com/google/inject/Binding.java
+++ b/src/com/google/inject/Binding.java
@@ -18,8 +18,8 @@
/**
* A mapping from a key (type and optional annotation) to a provider of
- * instances of that type. This interface is part of the Injector
- * Introspection API and is intended primary for use by tools.
+ * instances of that type. This interface is part of the {@link Injector}
+ * introspection API and is intended primary for use by tools.
*
* @author crazybob@google.com (Bob Lee)
*/
@@ -31,9 +31,9 @@
Key<T> getKey();
/**
- * Returns an arbitrary object containing information about the "place" where
- * this binding was configured. Used by guice in the production of descriptive
- * error messages.
+ * Returns an arbitrary object containing information about the "place"
+ * where this binding was configured. Used by Guice in the production of
+ * descriptive error messages.
*/
Object getSource();
diff --git a/src/com/google/inject/Guice.java b/src/com/google/inject/Guice.java
index f221605..317586c 100644
--- a/src/com/google/inject/Guice.java
+++ b/src/com/google/inject/Guice.java
@@ -29,11 +29,9 @@
/**
* Creates an injector with no explicit bindings.
*/
- public static Injector createInjector() {
+ public static Injector createEmptyInjector() {
try {
- return createInjector(new Module() {
- public void configure(Binder binder) {}
- });
+ return createInjector();
}
catch (CreationException e) {
throw new AssertionError(e);
diff --git a/src/com/google/inject/Inject.java b/src/com/google/inject/Inject.java
index b498b26..de449a7 100644
--- a/src/com/google/inject/Inject.java
+++ b/src/com/google/inject/Inject.java
@@ -25,8 +25,8 @@
/**
* Annotates members of your implementation class (constructors, methods
- * and fields) into which the {@link Injector} should inject references or
- * values. The Injector fulfills injection requests for:
+ * and fields) into which the {@link Injector} should inject values.
+ * The Injector fulfills injection requests for:
*
* <ul>
* <li>Every instance it constructs. The class being constructed must have
@@ -34,7 +34,9 @@
* constructor taking no parameters. The Injector then proceeds to perform
* method and field injections.
*
- * <li>Pre-constructed instances passed to {@link Injector#injectMembers}.
+ * <li>Pre-constructed instances passed to {@link Injector#injectMembers},
+ * {@link com.google.inject.binder.LinkedBindingBuilder#toInstance(Object)} and
+ * {@link com.google.inject.binder.LinkedBindingBuilder#toProvider(Provider)}.
* In this case all constructors are, of course, ignored.
*
* <li>Static fields and methods of classes which any {@link Module} has
diff --git a/src/com/google/inject/Injector.java b/src/com/google/inject/Injector.java
index 60f8fee..8ef7d8f 100644
--- a/src/com/google/inject/Injector.java
+++ b/src/com/google/inject/Injector.java
@@ -27,9 +27,9 @@
* "behind-the-scenes" operation is what distinguishes the Dependency Injection
* pattern from its cousin, Service Locator.
*
- * <p>The Injector API has a few additional features: it allows pre-constructed
- * instances to have their fields and methods injected, and offers programmatic
- * introspection to support tool development.
+ * <p>The {@code Injector} API has a few additional features: it allows
+ * pre-constructed instances to have their fields and methods injected and
+ * offers programmatic introspection to support tool development.
*
* <p>Contains several default bindings:
*
diff --git a/src/com/google/inject/Key.java b/src/com/google/inject/Key.java
index 01225da..b803adb 100644
--- a/src/com/google/inject/Key.java
+++ b/src/com/google/inject/Key.java
@@ -28,7 +28,7 @@
* Binding key consisting of an injection type and an optional annotation.
* Matches the type and annotation at a point of injection.
*
- * <p>For example, {@code Key.get(Service.class, Transactional.class) {}} will
+ * <p>For example, {@code Key.get(Service.class, Transactional.class)} will
* match:
*
* <pre>
diff --git a/src/com/google/inject/Module.java b/src/com/google/inject/Module.java
index b317f84..8894955 100644
--- a/src/com/google/inject/Module.java
+++ b/src/com/google/inject/Module.java
@@ -17,10 +17,10 @@
package com.google.inject;
/**
- * A module contributes a set of configuration data, typically interface
- * bindings, which will be used to create a {@link Injector}. A guice-based
- * application is ultimately composed of little but a set of Modules and some
- * bootstrapping code.
+ * 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.
*
* <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/ProvidedBy.java b/src/com/google/inject/ProvidedBy.java
index c790028..9df67d9 100644
--- a/src/com/google/inject/ProvidedBy.java
+++ b/src/com/google/inject/ProvidedBy.java
@@ -22,7 +22,7 @@
import java.lang.annotation.Target;
/**
- * A pointer to the default provider for a type.
+ * A pointer to the default provider type for a type.
*
* @author crazybob@google.com (Bob Lee)
*/
diff --git a/src/com/google/inject/Provider.java b/src/com/google/inject/Provider.java
index 68c22a9..fc52af5 100644
--- a/src/com/google/inject/Provider.java
+++ b/src/com/google/inject/Provider.java
@@ -18,13 +18,13 @@
/**
* Simply, any object capable of providing instances of type {@code T}.
- * Providers are used in numerous ways by the guice framework:
+ * Providers are used in numerous ways by the Guice framework:
*
* <ul>
* <li>When the default means for obtaining instances (an injectable or
* parameterless constructor) is insufficient for a particular binding, the
- * module can specify a custom Provider instead, to control exactly how guice
- * creates or obtains instances for the binding.
+ * module can specify a custom {@code Provider} instead, to control exactly how
+ * Guice creates or obtains instances for the binding.
*
* <li>An implementation class may always choose to have a {@code Provider<T>}
* instance injected, rather than having a {@code T} injected directly. This
@@ -49,7 +49,7 @@
public interface Provider<T> {
/**
- * Provides an instance of {@code T}. Must never return null.
+ * Provides an instance of {@code T}. Must never return {@code null}.
*/
T get();
}
diff --git a/src/com/google/inject/Scopes.java b/src/com/google/inject/Scopes.java
index 73214cd..80f8967 100644
--- a/src/com/google/inject/Scopes.java
+++ b/src/com/google/inject/Scopes.java
@@ -30,7 +30,7 @@
private Scopes() {}
/**
- * One instance per Injector. Also see {@code @}{@link Singleton}.
+ * One instance per {@link Injector}. Also see {@code @}{@link Singleton}.
*/
public static final Scope SINGLETON = new Scope() {
public <T> Provider<T> scope(Key<T> key, final Provider<T> creator) {
diff --git a/src/com/google/inject/Singleton.java b/src/com/google/inject/Singleton.java
index 923d15b..f4b81d5 100644
--- a/src/com/google/inject/Singleton.java
+++ b/src/com/google/inject/Singleton.java
@@ -22,8 +22,8 @@
import java.lang.annotation.Target;
/**
- * Apply this to implementation classes when you want only one instance (per
- * binding, per Injector) to be reused for all injections for that binding.
+ * Apply this to implementation classes when you want only one instance
+ * (per {@link Injector}) to be reused for all injections for that binding.
*
* @author crazybob@google.com (Bob Lee)
*/
diff --git a/src/com/google/inject/binder/package-info.java b/src/com/google/inject/binder/package-info.java
index b9a6d18..57ed875 100644
--- a/src/com/google/inject/binder/package-info.java
+++ b/src/com/google/inject/binder/package-info.java
@@ -15,7 +15,7 @@
*/
/**
- * Interface which make up {@link com.google.inject.Binder}'s
- * domain-specific language (DSL).
+ * Interfaces which make up {@link com.google.inject.Binder}'s
+ * expression language.
*/
package com.google.inject.binder;
\ No newline at end of file
diff --git a/src/com/google/inject/jndi/package-info.java b/src/com/google/inject/jndi/package-info.java
new file mode 100644
index 0000000..9d4a942
--- /dev/null
+++ b/src/com/google/inject/jndi/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2006 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * JNDI integration
+ */
+package com.google.inject.jndi;
\ No newline at end of file
diff --git a/src/com/google/inject/matcher/package-info.java b/src/com/google/inject/matcher/package-info.java
index 554ed5b..ced3238 100644
--- a/src/com/google/inject/matcher/package-info.java
+++ b/src/com/google/inject/matcher/package-info.java
@@ -15,6 +15,7 @@
*/
/**
- * A matcher API. Used to pick out methods to which to apply interceptors.
+ * Used for matching things. Primarily used to pick out methods to which to
+ * apply interceptors.
*/
package com.google.inject.matcher;
\ No newline at end of file
diff --git a/src/com/google/inject/package-info.java b/src/com/google/inject/package-info.java
index 7fb6c44..626bde2 100644
--- a/src/com/google/inject/package-info.java
+++ b/src/com/google/inject/package-info.java
@@ -16,7 +16,7 @@
/**
* <i>Google Guice</i> (pronounced "juice") is an ultra-lightweight dependency
- * injection tool. Please refer to the Guice
+ * injection framework. Please refer to the Guice
* <a href="http://docs.google.com/Doc?id=dd2fhx4z_5df5hw8">User's Guide</a>
* for a gentle introduction.
*
diff --git a/src/com/google/inject/spi/SourceProvider.java b/src/com/google/inject/spi/SourceProvider.java
index 7af45b6..127f5ba 100644
--- a/src/com/google/inject/spi/SourceProvider.java
+++ b/src/com/google/inject/spi/SourceProvider.java
@@ -17,7 +17,7 @@
package com.google.inject.spi;
/**
- * Provides source objects to the {@link com.google.inject.BinderImpl}.
+ * Provides source objects to the {@link com.google.inject.Binder}.
* A source object is any object which points back to the current location
* within the configuration. Guice uses source objects in error messages
* and associates them with bindings.
diff --git a/src/com/google/inject/tools/jmx/package-info.java b/src/com/google/inject/tools/jmx/package-info.java
new file mode 100644
index 0000000..694b6bd
--- /dev/null
+++ b/src/com/google/inject/tools/jmx/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2006 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * JMX integration
+ */
+package com.google.inject.tools.jmx;
\ No newline at end of file
diff --git a/test/com/google/inject/ImplicitBindingTest.java b/test/com/google/inject/ImplicitBindingTest.java
index 5c85154..6df202b 100644
--- a/test/com/google/inject/ImplicitBindingTest.java
+++ b/test/com/google/inject/ImplicitBindingTest.java
@@ -24,7 +24,7 @@
public class ImplicitBindingTest extends TestCase {
public void testCircularDependency() throws CreationException {
- Injector injector = Guice.createInjector();
+ Injector injector = Guice.createEmptyInjector();
Foo foo = injector.getInstance(Foo.class);
assertSame(foo, foo.bar.foo);
}
@@ -42,7 +42,7 @@
}
public void testDefaultImplementation() {
- Injector injector = Guice.createInjector();
+ Injector injector = Guice.createEmptyInjector();
I i = injector.getInstance(I.class);
i.go();
}
@@ -57,7 +57,7 @@
}
public void testDefaultProvider() {
- Injector injector = Guice.createInjector();
+ Injector injector = Guice.createEmptyInjector();
Provided provided = injector.getInstance(Provided.class);
provided.go();
}