unbreak build from last change
git-svn-id: https://google-guice.googlecode.com/svn/trunk@190 d779f126-a31b-0410-b53b-1d3aecad763e
diff --git a/src/com/google/inject/Binder.java b/src/com/google/inject/Binder.java
index 170e59c..a3fcecb 100644
--- a/src/com/google/inject/Binder.java
+++ b/src/com/google/inject/Binder.java
@@ -37,14 +37,14 @@
/**
* Binds the given key.
*/
- <T> BindingBuilderImpl<T> bind(Key<T> key);
+ <T> BindingBuilder<T> bind(Key<T> key);
/**
* Binds the given type.
*/
<T> BindingBuilder<T> bind(TypeLiteral<T> typeLiteral);
- <T> BindingBuilderImpl<T> bind(Class<T> clazz);
+ <T> BindingBuilder<T> bind(Class<T> clazz);
<T> LinkedBindingBuilder<T> link(Key<T> key);
diff --git a/src/com/google/inject/BinderImpl.java b/src/com/google/inject/BinderImpl.java
index eb7884f..1f3ea6c 100644
--- a/src/com/google/inject/BinderImpl.java
+++ b/src/com/google/inject/BinderImpl.java
@@ -19,9 +19,6 @@
import com.google.inject.ContainerImpl.Injector;
import com.google.inject.Key.AnnotationStrategy;
import static com.google.inject.Scopes.CONTAINER;
-import com.google.inject.binder.BindingBuilder;
-import com.google.inject.binder.ConstantBindingBuilder;
-import com.google.inject.binder.LinkedBindingBuilder;
import com.google.inject.matcher.Matcher;
import com.google.inject.spi.Message;
import com.google.inject.spi.SourceConsumer;
@@ -168,7 +165,7 @@
return builder;
}
- public <T> BindingBuilder<T> bind(TypeLiteral<T> typeLiteral) {
+ public <T> BindingBuilderImpl<T> bind(TypeLiteral<T> typeLiteral) {
return bind(Key.get(typeLiteral));
}
@@ -176,7 +173,7 @@
return bind(Key.get(clazz));
}
- public <T> LinkedBindingBuilder<T> link(Key<T> key) {
+ public <T> LinkedBindingBuilderImpl<T> link(Key<T> key) {
ensureNotCreated();
LinkedBindingBuilderImpl<T> builder =
new LinkedBindingBuilderImpl<T>(this, key).from(source());
@@ -186,26 +183,26 @@
// Next three methods not test-covered?
- public <T> LinkedBindingBuilder<T> link(Class<T> type) {
+ public <T> LinkedBindingBuilderImpl<T> link(Class<T> type) {
return link(Key.get(type));
}
- public <T> LinkedBindingBuilder<T> link(TypeLiteral<T> type) {
+ public <T> LinkedBindingBuilderImpl<T> link(TypeLiteral<T> type) {
return link(Key.get(type));
}
- public ConstantBindingBuilder bindConstant(Annotation annotation) {
+ public ConstantBindingBuilderImpl bindConstant(Annotation annotation) {
ensureNotCreated();
return bind(source(), Key.strategyFor(annotation));
}
- public ConstantBindingBuilder bindConstant(
+ public ConstantBindingBuilderImpl bindConstant(
Class<? extends Annotation> annotationType) {
ensureNotCreated();
return bind(source(), Key.strategyFor(annotationType));
}
- private ConstantBindingBuilder bind(Object source,
+ private ConstantBindingBuilderImpl bind(Object source,
AnnotationStrategy annotationStrategy) {
ConstantBindingBuilderImpl builder =
new ConstantBindingBuilderImpl(this, annotationStrategy).from(source);
diff --git a/src/com/google/inject/BindingBuilderImpl.java b/src/com/google/inject/BindingBuilderImpl.java
index 1bc2e16..6686516 100644
--- a/src/com/google/inject/BindingBuilderImpl.java
+++ b/src/com/google/inject/BindingBuilderImpl.java
@@ -38,7 +38,7 @@
return key;
}
- public BindingBuilder<T> annotatedWith(
+ public BindingBuilderImpl<T> annotatedWith(
Class<? extends Annotation> annotationType) {
if (this.key.hasAnnotationType()) {
binder.addError(source, ErrorMessages.ANNOTATION_ALREADY_SPECIFIED);
@@ -48,7 +48,7 @@
return this;
}
- public BindingBuilder<T> annotatedWith(Annotation annotation) {
+ public BindingBuilderImpl<T> annotatedWith(Annotation annotation) {
if (this.key.hasAnnotationType()) {
binder.addError(source, ErrorMessages.ANNOTATION_ALREADY_SPECIFIED);
} else {
@@ -58,11 +58,11 @@
return this;
}
- public <I extends T> BindingBuilder<T> to(Class<I> implementation) {
+ public <I extends T> BindingBuilderImpl<T> to(Class<I> implementation) {
return to(TypeLiteral.get(implementation));
}
- public <I extends T> BindingBuilder<T> to(
+ public <I extends T> BindingBuilderImpl<T> to(
final TypeLiteral<I> implementation) {
ensureImplementationIsNotSet();
this.implementation = implementation;
@@ -73,13 +73,13 @@
return this;
}
- public BindingBuilder<T> to(Factory<? extends T> factory) {
+ public BindingBuilderImpl<T> to(Factory<? extends T> factory) {
ensureImplementationIsNotSet();
this.factory = new InternalFactoryToFactoryAdapter<T>(factory);
return this;
}
- public BindingBuilder<T> to(T instance) {
+ public BindingBuilderImpl<T> to(T instance) {
ensureImplementationIsNotSet();
this.instance = Objects.nonNull(instance, "instance");
this.factory = new ConstantFactory<T>(instance);
@@ -93,23 +93,23 @@
/**
* Binds to instances from the given factory.
*/
- BindingBuilder<T> to(InternalFactory<? extends T> factory) {
+ BindingBuilderImpl<T> to(InternalFactory<? extends T> factory) {
ensureImplementationIsNotSet();
this.factory = factory;
return this;
}
- public BindingBuilder<T> toFactory(
+ public BindingBuilderImpl<T> toFactory(
final Class<? extends Factory<T>> factoryType) {
return toFactory(Key.get(factoryType));
}
- public BindingBuilder<T> toFactory(
+ public BindingBuilderImpl<T> toFactory(
final TypeLiteral<? extends Factory<T>> factoryType) {
return toFactory(Key.get(factoryType));
}
- public BindingBuilder<T> toFactory(
+ public BindingBuilderImpl<T> toFactory(
final Key<? extends Factory<T>> factoryKey) {
ensureImplementationIsNotSet();
@@ -130,7 +130,7 @@
}
}
- public BindingBuilder<T> in(Class<? extends Annotation> scopeAnnotation) {
+ public BindingBuilderImpl<T> in(Class<? extends Annotation> scopeAnnotation) {
// this method not test-covered
ensureScopeNotSet();
@@ -145,7 +145,7 @@
return this;
}
- public BindingBuilder<T> in(Scope scope) {
+ public BindingBuilderImpl<T> in(Scope scope) {
ensureScopeNotSet();
this.scope = Objects.nonNull(scope, "scope");
return this;
@@ -163,7 +163,7 @@
}
}
- public BindingBuilder<T> eagerly() {
+ public BindingBuilderImpl<T> eagerly() {
this.preload = true;
return this;
}
diff --git a/src/com/google/inject/name/Names.java b/src/com/google/inject/name/Names.java
index e701ca8..28ed13a 100644
--- a/src/com/google/inject/name/Names.java
+++ b/src/com/google/inject/name/Names.java
@@ -16,6 +16,7 @@
package com.google.inject.name;
+import com.google.inject.Binder;
import com.google.inject.BinderImpl;
import com.google.inject.Key;
import com.google.inject.spi.DefaultSourceProvider;
@@ -42,26 +43,28 @@
/**
* Creates a constant binding to {@code @Named(key)} for each property.
*/
- public static void bindProperties(BinderImpl builder,
+ public static void bindProperties(BinderImpl binder,
Map<String, String> properties) {
- skipNames(builder);
+ skipNames(binder);
for (Map.Entry<String, String> entry : properties.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
- builder.bind(Key.get(String.class, new NamedImpl(key))).to(value);
+ ((Binder) binder).bind(
+ Key.get(String.class, new NamedImpl(key))).to(value);
}
}
/**
* Creates a constant binding to {@code @Named(key)} for each property.
*/
- public static void bindProperties(BinderImpl builder,
+ public static void bindProperties(BinderImpl binder,
Properties properties) {
- skipNames(builder);
+ skipNames(binder);
for (Map.Entry<Object, Object> entry : properties.entrySet()) {
String key = (String) entry.getKey();
String value = (String) entry.getValue();
- builder.bind(Key.get(String.class, new NamedImpl(key))).to(value);
+ ((Binder) binder).bind(
+ Key.get(String.class, new NamedImpl(key))).to(value);
}
}