blob: c564c71acdf8bddec96a9761f057a8460b9c5ae8 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_07) on Thu Mar 19 15:41:16 PDT 2009 -->
<TITLE>
Binder (Guice 2.0 API)
</TITLE>
<META NAME="date" CONTENT="2009-03-19">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Binder (Guice 2.0 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../com/google/inject/AbstractModule.html" title="class in com.google.inject"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../com/google/inject/Binding.html" title="interface in com.google.inject"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?com/google/inject/Binder.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Binder.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.google.inject</FONT>
<BR>
Interface Binder</H2>
<DL>
<DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../com/google/inject/PrivateBinder.html" title="interface in com.google.inject">PrivateBinder</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>Binder</B></DL>
</PRE>
<P>
Collects configuration information (primarily <i>bindings</i>) which will be
used to create an <A HREF="../../../com/google/inject/Injector.html" title="interface in com.google.inject"><CODE>Injector</CODE></A>. Guice provides this object to your
application's <A HREF="../../../com/google/inject/Module.html" title="interface in com.google.inject"><CODE>Module</CODE></A> implementors so they may each contribute
their own bindings and other registrations.
<h3>The Guice Binding EDSL</h3>
Guice uses an <i>embedded domain-specific language</i>, or EDSL, to help you
create bindings simply and readably. This approach is great for overall
usability, but it does come with a small cost: <b>it is difficult to
learn how to use the Binding EDSL by reading
method-level javadocs</b>. Instead, you should consult the series of
examples below. To save space, these examples omit the opening
<code>binder</code>, just as you will if your module extends
<A HREF="../../../com/google/inject/AbstractModule.html" title="class in com.google.inject"><CODE>AbstractModule</CODE></A>.
<pre>
bind(ServiceImpl.class);</pre>
This statement does essentially nothing; it "binds the <code>ServiceImpl</code>
class to itself" and does not change Guice's default behavior. You may still
want to use this if you prefer your <A HREF="../../../com/google/inject/Module.html" title="interface in com.google.inject"><CODE>Module</CODE></A> class to serve as an
explicit <i>manifest</i> for the services it provides. Also, in rare cases,
Guice may be unable to validate a binding at injector creation time unless it
is given explicitly.
<pre>
bind(Service.class).to(ServiceImpl.class);</pre>
Specifies that a request for a <code>Service</code> instance with no binding
annotations should be treated as if it were a request for a
<code>ServiceImpl</code> instance. This <i>overrides</i> the function of any
<A HREF="../../../com/google/inject/ImplementedBy.html" title="annotation in com.google.inject"><CODE>@ImplementedBy</CODE></A> or <A HREF="../../../com/google/inject/ProvidedBy.html" title="annotation in com.google.inject"><CODE>@ProvidedBy</CODE></A>
annotations found on <code>Service</code>, since Guice will have already
"moved on" to <code>ServiceImpl</code> before it reaches the point when it starts
looking for these annotations.
<pre>
bind(Service.class).toProvider(ServiceProvider.class);</pre>
In this example, <code>ServiceProvider</code> must extend or implement
<code>Provider&lt;Service&gt;</code>. This binding specifies that Guice should resolve
an unannotated injection request for <code>Service</code> by first resolving an
instance of <code>ServiceProvider</code> in the regular way, then calling
<A HREF="../../../com/google/inject/Provider.html#get()"><CODE>get()</CODE></A> on the resulting Provider instance to obtain the
<code>Service</code> instance.
<p>The <A HREF="../../../com/google/inject/Provider.html" title="interface in com.google.inject"><CODE>Provider</CODE></A> you use here does not have to be a "factory"; that
is, a provider which always <i>creates</i> each instance it provides.
However, this is generally a good practice to follow. You can then use
Guice's concept of <A HREF="../../../com/google/inject/Scope.html" title="interface in com.google.inject"><CODE>scopes</CODE></A> to guide when creation should happen
-- "letting Guice work for you".
<pre>
bind(Service.class).annotatedWith(Red.class).to(ServiceImpl.class);</pre>
Like the previous example, but only applies to injection requests that use
the binding annotation <code>@Red</code>. If your module also includes bindings
for particular <i>values</i> of the <code>@Red</code> annotation (see below),
then this binding will serve as a "catch-all" for any values of <code>@Red</code>
that have no exact match in the bindings.
<pre>
bind(ServiceImpl.class).in(Singleton.class);
// or, alternatively
bind(ServiceImpl.class).in(Scopes.SINGLETON);</pre>
Either of these statements places the <code>ServiceImpl</code> class into
singleton scope. Guice will create only one instance of <code>ServiceImpl</code>
and will reuse it for all injection requests of this type. Note that it is
still possible to bind another instance of <code>ServiceImpl</code> if the second
binding is qualified by an annotation as in the previous example. Guice is
not overly concerned with <i>preventing</i> you from creating multiple
instances of your "singletons", only with <i>enabling</i> your application to
share only one instance if that's all you tell Guice you need.
<p><b>Note:</b> a scope specified in this way <i>overrides</i> any scope that
was specified with an annotation on the <code>ServiceImpl</code> class.
<p>Besides <A HREF="../../../com/google/inject/Singleton.html" title="annotation in com.google.inject"><CODE>Singleton</CODE></A>/<A HREF="../../../com/google/inject/Scopes.html#SINGLETON"><CODE>Scopes.SINGLETON</CODE></A>, there are
servlet-specific scopes available in
<code>com.google.inject.servlet.ServletScopes</code>, and your Modules can
contribute their own custom scopes for use here as well.
<pre>
bind(new TypeLiteral&lt;PaymentService&lt;CreditCard>>() {})
.to(CreditCardPaymentService.class);</pre>
This admittedly odd construct is the way to bind a parameterized type. It
tells Guice how to honor an injection request for an element of type
<code>PaymentService&lt;CreditCard&gt;</code>. The class
<code>CreditCardPaymentService</code> must implement the
<code>PaymentService&lt;CreditCard&gt;</code> interface. Guice cannot currently bind or
inject a generic type, such as <code>Set&lt;E&gt;</code>; all type parameters must be
fully specified.
<pre>
bind(Service.class).toInstance(new ServiceImpl());
// or, alternatively
bind(Service.class).toInstance(SomeLegacyRegistry.getService());</pre>
In this example, your module itself, <i>not Guice</i>, takes responsibility
for obtaining a <code>ServiceImpl</code> instance, then asks Guice to always use
this single instance to fulfill all <code>Service</code> injection requests. When
the <A HREF="../../../com/google/inject/Injector.html" title="interface in com.google.inject"><CODE>Injector</CODE></A> is created, it will automatically perform field
and method injection for this instance, but any injectable constructor on
<code>ServiceImpl</code> is simply ignored. Note that using this approach results
in "eager loading" behavior that you can't control.
<pre>
bindConstant().annotatedWith(ServerHost.class).to(args[0]);</pre>
Sets up a constant binding. Constant injections must always be annotated.
When a constant binding's value is a string, it is eligile for conversion to
all primitive types, to <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Enum.html?is-external=true#valueOf(java.lang.Class, java.lang.String)" title="class or interface in java.lang"><CODE>all enums</CODE></A>, and to
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true#forName(java.lang.String)" title="class or interface in java.lang"><CODE>class literals</CODE></A>. Conversions for other types can be
configured using <A HREF="../../../com/google/inject/Binder.html#convertToTypes(com.google.inject.matcher.Matcher, com.google.inject.spi.TypeConverter)"><CODE>convertToTypes()</CODE></A>.
<pre>
@Color("red") Color red; // A member variable (field)
. . .
red = MyModule.class.getDeclaredField("red").getAnnotation(Color.class);
bind(Service.class).annotatedWith(red).to(RedService.class);</pre>
If your binding annotation has parameters you can apply different bindings to
different specific values of your annotation. Getting your hands on the
right instance of the annotation is a bit of a pain -- one approach, shown
above, is to apply a prototype annotation to a field in your module class, so
that you can read this annotation instance and give it to Guice.
<pre>
bind(Service.class)
.annotatedWith(Names.named("blue"))
.to(BlueService.class);</pre>
Differentiating by names is a common enough use case that we provided a
standard annotation, <A HREF="../../../com/google/inject/name/Named.html" title="annotation in com.google.inject.name"><CODE>@Named</CODE></A>. Because of
Guice's library support, binding by name is quite easier than in the
arbitrary binding annotation case we just saw. However, remember that these
names will live in a single flat namespace with all the other names used in
your application.
<p>The above list of examples is far from exhaustive. If you can think of
how the concepts of one example might coexist with the concepts from another,
you can most likely weave the two together. If the two concepts make no
sense with each other, you most likely won't be able to do it. In a few
cases Guice will let something bogus slip by, and will then inform you of
the problems at runtime, as soon as you try to create your Injector.
<p>The other methods of Binder such as <A HREF="../../../com/google/inject/Binder.html#bindScope(java.lang.Class, com.google.inject.Scope)"><CODE>bindScope(java.lang.Class<? extends java.lang.annotation.Annotation>, com.google.inject.Scope)</CODE></A>,
<A HREF="../../../com/google/inject/Binder.html#bindInterceptor(com.google.inject.matcher.Matcher, com.google.inject.matcher.Matcher, org.aopalliance.intercept.MethodInterceptor...)"><CODE>bindInterceptor(com.google.inject.matcher.Matcher<? super java.lang.Class<?>>, com.google.inject.matcher.Matcher<? super java.lang.reflect.Method>, org.aopalliance.intercept.MethodInterceptor...)</CODE></A>, <A HREF="../../../com/google/inject/Binder.html#install(com.google.inject.Module)"><CODE>install(com.google.inject.Module)</CODE></A>, <A HREF="../../../com/google/inject/Binder.html#requestStaticInjection(java.lang.Class...)"><CODE>requestStaticInjection(java.lang.Class<?>...)</CODE></A>,
<A HREF="../../../com/google/inject/Binder.html#addError(java.lang.String, java.lang.Object...)"><CODE>addError(java.lang.String, java.lang.Object...)</CODE></A> and <A HREF="../../../com/google/inject/Binder.html#currentStage()"><CODE>currentStage()</CODE></A> are not part of the Binding EDSL;
you can learn how to use these in the usual way, from the method
documentation.
<P>
<P>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#addError(com.google.inject.spi.Message)">addError</A></B>(<A HREF="../../../com/google/inject/spi/Message.html" title="class in com.google.inject.spi">Message</A>&nbsp;message)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Records an error message to be presented to the user at a later time.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#addError(java.lang.String, java.lang.Object...)">addError</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;message,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>...&nbsp;arguments)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Records an error message which will be presented to the user at a later
time.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#addError(java.lang.Throwable)">addError</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</A>&nbsp;t)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Records an exception, the full details of which will be logged, and the
message of which will be presented to the user at a later
time.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; <A HREF="../../../com/google/inject/binder/AnnotatedBindingBuilder.html" title="interface in com.google.inject.binder">AnnotatedBindingBuilder</A>&lt;T&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#bind(java.lang.Class)">bind</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;type)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;See the EDSL examples at <A HREF="../../../com/google/inject/Binder.html" title="interface in com.google.inject"><CODE>Binder</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; <A HREF="../../../com/google/inject/binder/LinkedBindingBuilder.html" title="interface in com.google.inject.binder">LinkedBindingBuilder</A>&lt;T&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#bind(com.google.inject.Key)">bind</A></B>(<A HREF="../../../com/google/inject/Key.html" title="class in com.google.inject">Key</A>&lt;T&gt;&nbsp;key)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;See the EDSL examples at <A HREF="../../../com/google/inject/Binder.html" title="interface in com.google.inject"><CODE>Binder</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; <A HREF="../../../com/google/inject/binder/AnnotatedBindingBuilder.html" title="interface in com.google.inject.binder">AnnotatedBindingBuilder</A>&lt;T&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#bind(com.google.inject.TypeLiteral)">bind</A></B>(<A HREF="../../../com/google/inject/TypeLiteral.html" title="class in com.google.inject">TypeLiteral</A>&lt;T&gt;&nbsp;typeLiteral)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;See the EDSL examples at <A HREF="../../../com/google/inject/Binder.html" title="interface in com.google.inject"><CODE>Binder</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../com/google/inject/binder/AnnotatedConstantBindingBuilder.html" title="interface in com.google.inject.binder">AnnotatedConstantBindingBuilder</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#bindConstant()">bindConstant</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;See the EDSL examples at <A HREF="../../../com/google/inject/Binder.html" title="interface in com.google.inject"><CODE>Binder</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#bindInterceptor(com.google.inject.matcher.Matcher, com.google.inject.matcher.Matcher, org.aopalliance.intercept.MethodInterceptor...)">bindInterceptor</A></B>(<A HREF="../../../com/google/inject/matcher/Matcher.html" title="interface in com.google.inject.matcher">Matcher</A>&lt;? super <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;&gt;&nbsp;classMatcher,
<A HREF="../../../com/google/inject/matcher/Matcher.html" title="interface in com.google.inject.matcher">Matcher</A>&lt;? super <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</A>&gt;&nbsp;methodMatcher,
<A HREF="http://aopalliance.sourceforge.net/doc/org/aopalliance/intercept/MethodInterceptor.html?is-external=true" title="class or interface in org.aopalliance.intercept">MethodInterceptor</A>...&nbsp;interceptors)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Binds method interceptor[s] to methods matched by class and method matchers.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#bindListener(com.google.inject.matcher.Matcher, com.google.inject.spi.InjectableType.Listener)">bindListener</A></B>(<A HREF="../../../com/google/inject/matcher/Matcher.html" title="interface in com.google.inject.matcher">Matcher</A>&lt;? super <A HREF="../../../com/google/inject/TypeLiteral.html" title="class in com.google.inject">TypeLiteral</A>&lt;?&gt;&gt;&nbsp;typeMatcher,
<A HREF="../../../com/google/inject/spi/InjectableType.Listener.html" title="interface in com.google.inject.spi">InjectableType.Listener</A>&nbsp;listener)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Registers a listener for injectable types.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#bindScope(java.lang.Class, com.google.inject.Scope)">bindScope</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;? extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</A>&gt;&nbsp;annotationType,
<A HREF="../../../com/google/inject/Scope.html" title="interface in com.google.inject">Scope</A>&nbsp;scope)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Binds a scope to an annotation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#convertToTypes(com.google.inject.matcher.Matcher, com.google.inject.spi.TypeConverter)">convertToTypes</A></B>(<A HREF="../../../com/google/inject/matcher/Matcher.html" title="interface in com.google.inject.matcher">Matcher</A>&lt;? super <A HREF="../../../com/google/inject/TypeLiteral.html" title="class in com.google.inject">TypeLiteral</A>&lt;?&gt;&gt;&nbsp;typeMatcher,
<A HREF="../../../com/google/inject/spi/TypeConverter.html" title="interface in com.google.inject.spi">TypeConverter</A>&nbsp;converter)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Binds a type converter.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../com/google/inject/Stage.html" title="enum in com.google.inject">Stage</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#currentStage()">currentStage</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the current stage.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; <A HREF="../../../com/google/inject/MembersInjector.html" title="interface in com.google.inject">MembersInjector</A>&lt;T&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#getMembersInjector(java.lang.Class)">getMembersInjector</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;type)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the members injector used to inject dependencies into methods and fields on instances
of the given type <code>T</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; <A HREF="../../../com/google/inject/MembersInjector.html" title="interface in com.google.inject">MembersInjector</A>&lt;T&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#getMembersInjector(com.google.inject.TypeLiteral)">getMembersInjector</A></B>(<A HREF="../../../com/google/inject/TypeLiteral.html" title="class in com.google.inject">TypeLiteral</A>&lt;T&gt;&nbsp;typeLiteral)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the members injector used to inject dependencies into methods and fields on instances
of the given type <code>T</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; <A HREF="../../../com/google/inject/Provider.html" title="interface in com.google.inject">Provider</A>&lt;T&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#getProvider(java.lang.Class)">getProvider</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;type)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the provider used to obtain instances for the given injection type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; <A HREF="../../../com/google/inject/Provider.html" title="interface in com.google.inject">Provider</A>&lt;T&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#getProvider(com.google.inject.Key)">getProvider</A></B>(<A HREF="../../../com/google/inject/Key.html" title="class in com.google.inject">Key</A>&lt;T&gt;&nbsp;key)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the provider used to obtain instances for the given injection key.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#install(com.google.inject.Module)">install</A></B>(<A HREF="../../../com/google/inject/Module.html" title="interface in com.google.inject">Module</A>&nbsp;module)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Uses the given module to configure more bindings.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../com/google/inject/PrivateBinder.html" title="interface in com.google.inject">PrivateBinder</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#newPrivateBinder()">newPrivateBinder</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new private child environment for bindings and other configuration.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#requestInjection(java.lang.Object)">requestInjection</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;instance)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Upon successful creation, the <A HREF="../../../com/google/inject/Injector.html" title="interface in com.google.inject"><CODE>Injector</CODE></A> will inject instance fields
and methods of the given object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; void</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#requestInjection(com.google.inject.TypeLiteral, T)">requestInjection</A></B>(<A HREF="../../../com/google/inject/TypeLiteral.html" title="class in com.google.inject">TypeLiteral</A>&lt;T&gt;&nbsp;type,
T&nbsp;instance)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Upon successful creation, the <A HREF="../../../com/google/inject/Injector.html" title="interface in com.google.inject"><CODE>Injector</CODE></A> will inject instance fields
and methods of the given object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#requestStaticInjection(java.lang.Class...)">requestStaticInjection</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;...&nbsp;types)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Upon successful creation, the <A HREF="../../../com/google/inject/Injector.html" title="interface in com.google.inject"><CODE>Injector</CODE></A> will inject static fields
and methods in the given classes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../com/google/inject/Binder.html" title="interface in com.google.inject">Binder</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#skipSources(java.lang.Class...)">skipSources</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>...&nbsp;classesToSkip)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a binder that skips <code>classesToSkip</code> when identify the
calling code.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../com/google/inject/Binder.html" title="interface in com.google.inject">Binder</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/google/inject/Binder.html#withSource(java.lang.Object)">withSource</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;source)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a binder that uses <code>source</code> as the reference location for
configuration errors.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="bindInterceptor(com.google.inject.matcher.Matcher, com.google.inject.matcher.Matcher, org.aopalliance.intercept.MethodInterceptor...)"><!-- --></A><H3>
bindInterceptor</H3>
<PRE>
void <B>bindInterceptor</B>(<A HREF="../../../com/google/inject/matcher/Matcher.html" title="interface in com.google.inject.matcher">Matcher</A>&lt;? super <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;&gt;&nbsp;classMatcher,
<A HREF="../../../com/google/inject/matcher/Matcher.html" title="interface in com.google.inject.matcher">Matcher</A>&lt;? super <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</A>&gt;&nbsp;methodMatcher,
<A HREF="http://aopalliance.sourceforge.net/doc/org/aopalliance/intercept/MethodInterceptor.html?is-external=true" title="class or interface in org.aopalliance.intercept">MethodInterceptor</A>...&nbsp;interceptors)</PRE>
<DL>
<DD>Binds method interceptor[s] to methods matched by class and method matchers. A method is
eligible for interception if:
<ul>
<li>Guice created the instance the method is on</li>
<li>Neither the enclosing type nor the method is final</li>
<li>And the method is package-private, protected, or public</li>
</ul>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>classMatcher</CODE> - matches classes the interceptor should apply to. For
example: <code>only(Runnable.class)</code>.<DD><CODE>methodMatcher</CODE> - matches methods the interceptor should apply to. For
example: <code>annotatedWith(Transactional.class)</code>.<DD><CODE>interceptors</CODE> - to bind</DL>
</DD>
</DL>
<HR>
<A NAME="bindScope(java.lang.Class, com.google.inject.Scope)"><!-- --></A><H3>
bindScope</H3>
<PRE>
void <B>bindScope</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;? extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</A>&gt;&nbsp;annotationType,
<A HREF="../../../com/google/inject/Scope.html" title="interface in com.google.inject">Scope</A>&nbsp;scope)</PRE>
<DL>
<DD>Binds a scope to an annotation.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="bind(com.google.inject.Key)"><!-- --></A><H3>
bind</H3>
<PRE>
&lt;T&gt; <A HREF="../../../com/google/inject/binder/LinkedBindingBuilder.html" title="interface in com.google.inject.binder">LinkedBindingBuilder</A>&lt;T&gt; <B>bind</B>(<A HREF="../../../com/google/inject/Key.html" title="class in com.google.inject">Key</A>&lt;T&gt;&nbsp;key)</PRE>
<DL>
<DD>See the EDSL examples at <A HREF="../../../com/google/inject/Binder.html" title="interface in com.google.inject"><CODE>Binder</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="bind(com.google.inject.TypeLiteral)"><!-- --></A><H3>
bind</H3>
<PRE>
&lt;T&gt; <A HREF="../../../com/google/inject/binder/AnnotatedBindingBuilder.html" title="interface in com.google.inject.binder">AnnotatedBindingBuilder</A>&lt;T&gt; <B>bind</B>(<A HREF="../../../com/google/inject/TypeLiteral.html" title="class in com.google.inject">TypeLiteral</A>&lt;T&gt;&nbsp;typeLiteral)</PRE>
<DL>
<DD>See the EDSL examples at <A HREF="../../../com/google/inject/Binder.html" title="interface in com.google.inject"><CODE>Binder</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="bind(java.lang.Class)"><!-- --></A><H3>
bind</H3>
<PRE>
&lt;T&gt; <A HREF="../../../com/google/inject/binder/AnnotatedBindingBuilder.html" title="interface in com.google.inject.binder">AnnotatedBindingBuilder</A>&lt;T&gt; <B>bind</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;type)</PRE>
<DL>
<DD>See the EDSL examples at <A HREF="../../../com/google/inject/Binder.html" title="interface in com.google.inject"><CODE>Binder</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="bindConstant()"><!-- --></A><H3>
bindConstant</H3>
<PRE>
<A HREF="../../../com/google/inject/binder/AnnotatedConstantBindingBuilder.html" title="interface in com.google.inject.binder">AnnotatedConstantBindingBuilder</A> <B>bindConstant</B>()</PRE>
<DL>
<DD>See the EDSL examples at <A HREF="../../../com/google/inject/Binder.html" title="interface in com.google.inject"><CODE>Binder</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="requestInjection(com.google.inject.TypeLiteral,java.lang.Object)"><!-- --></A><A NAME="requestInjection(com.google.inject.TypeLiteral, T)"><!-- --></A><H3>
requestInjection</H3>
<PRE>
&lt;T&gt; void <B>requestInjection</B>(<A HREF="../../../com/google/inject/TypeLiteral.html" title="class in com.google.inject">TypeLiteral</A>&lt;T&gt;&nbsp;type,
T&nbsp;instance)</PRE>
<DL>
<DD>Upon successful creation, the <A HREF="../../../com/google/inject/Injector.html" title="interface in com.google.inject"><CODE>Injector</CODE></A> will inject instance fields
and methods of the given object.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>type</CODE> - of instance<DD><CODE>instance</CODE> - for which members will be injected<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="requestInjection(java.lang.Object)"><!-- --></A><H3>
requestInjection</H3>
<PRE>
void <B>requestInjection</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;instance)</PRE>
<DL>
<DD>Upon successful creation, the <A HREF="../../../com/google/inject/Injector.html" title="interface in com.google.inject"><CODE>Injector</CODE></A> will inject instance fields
and methods of the given object.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>instance</CODE> - for which members will be injected<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="requestStaticInjection(java.lang.Class...)"><!-- --></A><H3>
requestStaticInjection</H3>
<PRE>
void <B>requestStaticInjection</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;...&nbsp;types)</PRE>
<DL>
<DD>Upon successful creation, the <A HREF="../../../com/google/inject/Injector.html" title="interface in com.google.inject"><CODE>Injector</CODE></A> will inject static fields
and methods in the given classes.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>types</CODE> - for which static members will be injected</DL>
</DD>
</DL>
<HR>
<A NAME="install(com.google.inject.Module)"><!-- --></A><H3>
install</H3>
<PRE>
void <B>install</B>(<A HREF="../../../com/google/inject/Module.html" title="interface in com.google.inject">Module</A>&nbsp;module)</PRE>
<DL>
<DD>Uses the given module to configure more bindings.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="currentStage()"><!-- --></A><H3>
currentStage</H3>
<PRE>
<A HREF="../../../com/google/inject/Stage.html" title="enum in com.google.inject">Stage</A> <B>currentStage</B>()</PRE>
<DL>
<DD>Gets the current stage.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="addError(java.lang.String, java.lang.Object...)"><!-- --></A><H3>
addError</H3>
<PRE>
void <B>addError</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;message,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>...&nbsp;arguments)</PRE>
<DL>
<DD>Records an error message which will be presented to the user at a later
time. Unlike throwing an exception, this enable us to continue
configuring the Injector and discover more errors. Uses <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true#format(java.lang.String, java.lang.Object...)" title="class or interface in java.lang"><CODE>String.format(String, Object[])</CODE></A> to insert the arguments into the
message.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="addError(java.lang.Throwable)"><!-- --></A><H3>
addError</H3>
<PRE>
void <B>addError</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</A>&nbsp;t)</PRE>
<DL>
<DD>Records an exception, the full details of which will be logged, and the
message of which will be presented to the user at a later
time. If your Module calls something that you worry may fail, you should
catch the exception and pass it into this.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="addError(com.google.inject.spi.Message)"><!-- --></A><H3>
addError</H3>
<PRE>
void <B>addError</B>(<A HREF="../../../com/google/inject/spi/Message.html" title="class in com.google.inject.spi">Message</A>&nbsp;message)</PRE>
<DL>
<DD>Records an error message to be presented to the user at a later time.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getProvider(com.google.inject.Key)"><!-- --></A><H3>
getProvider</H3>
<PRE>
&lt;T&gt; <A HREF="../../../com/google/inject/Provider.html" title="interface in com.google.inject">Provider</A>&lt;T&gt; <B>getProvider</B>(<A HREF="../../../com/google/inject/Key.html" title="class in com.google.inject">Key</A>&lt;T&gt;&nbsp;key)</PRE>
<DL>
<DD>Returns the provider used to obtain instances for the given injection key.
The returned will not be valid until the <A HREF="../../../com/google/inject/Injector.html" title="interface in com.google.inject"><CODE>Injector</CODE></A> has been
created. The provider will throw an <code>IllegalStateException</code> if you
try to use it beforehand.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getProvider(java.lang.Class)"><!-- --></A><H3>
getProvider</H3>
<PRE>
&lt;T&gt; <A HREF="../../../com/google/inject/Provider.html" title="interface in com.google.inject">Provider</A>&lt;T&gt; <B>getProvider</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;type)</PRE>
<DL>
<DD>Returns the provider used to obtain instances for the given injection type.
The returned provider will not be valid until the <A HREF="../../../com/google/inject/Injector.html" title="interface in com.google.inject"><CODE>Injector</CODE></A> has been
created. The provider will throw an <code>IllegalStateException</code> if you
try to use it beforehand.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getMembersInjector(com.google.inject.TypeLiteral)"><!-- --></A><H3>
getMembersInjector</H3>
<PRE>
&lt;T&gt; <A HREF="../../../com/google/inject/MembersInjector.html" title="interface in com.google.inject">MembersInjector</A>&lt;T&gt; <B>getMembersInjector</B>(<A HREF="../../../com/google/inject/TypeLiteral.html" title="class in com.google.inject">TypeLiteral</A>&lt;T&gt;&nbsp;typeLiteral)</PRE>
<DL>
<DD>Returns the members injector used to inject dependencies into methods and fields on instances
of the given type <code>T</code>. The returned members injector will not be valid until the main
<A HREF="../../../com/google/inject/Injector.html" title="interface in com.google.inject"><CODE>Injector</CODE></A> has been created. The members injector will throw an <code>IllegalStateException</code> if you try to use it beforehand.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>typeLiteral</CODE> - type to get members injector for<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getMembersInjector(java.lang.Class)"><!-- --></A><H3>
getMembersInjector</H3>
<PRE>
&lt;T&gt; <A HREF="../../../com/google/inject/MembersInjector.html" title="interface in com.google.inject">MembersInjector</A>&lt;T&gt; <B>getMembersInjector</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;type)</PRE>
<DL>
<DD>Returns the members injector used to inject dependencies into methods and fields on instances
of the given type <code>T</code>. The returned members injector will not be valid until the main
<A HREF="../../../com/google/inject/Injector.html" title="interface in com.google.inject"><CODE>Injector</CODE></A> has been created. The members injector will throw an <code>IllegalStateException</code> if you try to use it beforehand.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>type</CODE> - type to get members injector for<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="convertToTypes(com.google.inject.matcher.Matcher, com.google.inject.spi.TypeConverter)"><!-- --></A><H3>
convertToTypes</H3>
<PRE>
void <B>convertToTypes</B>(<A HREF="../../../com/google/inject/matcher/Matcher.html" title="interface in com.google.inject.matcher">Matcher</A>&lt;? super <A HREF="../../../com/google/inject/TypeLiteral.html" title="class in com.google.inject">TypeLiteral</A>&lt;?&gt;&gt;&nbsp;typeMatcher,
<A HREF="../../../com/google/inject/spi/TypeConverter.html" title="interface in com.google.inject.spi">TypeConverter</A>&nbsp;converter)</PRE>
<DL>
<DD>Binds a type converter. The injector will use the given converter to
convert string constants to matching types as needed.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>typeMatcher</CODE> - matches types the converter can handle<DD><CODE>converter</CODE> - converts values<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="bindListener(com.google.inject.matcher.Matcher, com.google.inject.spi.InjectableType.Listener)"><!-- --></A><H3>
bindListener</H3>
<PRE>
void <B>bindListener</B>(<A HREF="../../../com/google/inject/matcher/Matcher.html" title="interface in com.google.inject.matcher">Matcher</A>&lt;? super <A HREF="../../../com/google/inject/TypeLiteral.html" title="class in com.google.inject">TypeLiteral</A>&lt;?&gt;&gt;&nbsp;typeMatcher,
<A HREF="../../../com/google/inject/spi/InjectableType.Listener.html" title="interface in com.google.inject.spi">InjectableType.Listener</A>&nbsp;listener)</PRE>
<DL>
<DD>Registers a listener for injectable types. Guice will notify the listener when it encounters
injectable types matched by the given type matcher.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>typeMatcher</CODE> - that matches injectable types the listener should be notified of<DD><CODE>listener</CODE> - for injectable types matched by typeMatcher<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="withSource(java.lang.Object)"><!-- --></A><H3>
withSource</H3>
<PRE>
<A HREF="../../../com/google/inject/Binder.html" title="interface in com.google.inject">Binder</A> <B>withSource</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;source)</PRE>
<DL>
<DD>Returns a binder that uses <code>source</code> as the reference location for
configuration errors. This is typically a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/StackTraceElement.html?is-external=true" title="class or interface in java.lang"><CODE>StackTraceElement</CODE></A>
for <code>.java</code> source but it could any binding source, such as the
path to a <code>.properties</code> file.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - any object representing the source location and has a
concise <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang"><CODE>toString()</CODE></A> value
<DT><B>Returns:</B><DD>a binder that shares its configuration with this binder<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="skipSources(java.lang.Class...)"><!-- --></A><H3>
skipSources</H3>
<PRE>
<A HREF="../../../com/google/inject/Binder.html" title="interface in com.google.inject">Binder</A> <B>skipSources</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>...&nbsp;classesToSkip)</PRE>
<DL>
<DD>Returns a binder that skips <code>classesToSkip</code> when identify the
calling code. The caller's <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/StackTraceElement.html?is-external=true" title="class or interface in java.lang"><CODE>StackTraceElement</CODE></A> is used to locate
the source of configuration errors.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>classesToSkip</CODE> - library classes that create bindings on behalf of
their clients.
<DT><B>Returns:</B><DD>a binder that shares its configuration with this binder.<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="newPrivateBinder()"><!-- --></A><H3>
newPrivateBinder</H3>
<PRE>
<A HREF="../../../com/google/inject/PrivateBinder.html" title="interface in com.google.inject">PrivateBinder</A> <B>newPrivateBinder</B>()</PRE>
<DL>
<DD>Creates a new private child environment for bindings and other configuration. The returned
binder can be used to add and configuration information in this environment. See <A HREF="../../../com/google/inject/PrivateModule.html" title="class in com.google.inject"><CODE>PrivateModule</CODE></A> for details.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>a binder that inherits configuration from this binder. Only exposed configuration on
the returned binder will be visible to this binder.<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../com/google/inject/AbstractModule.html" title="class in com.google.inject"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../com/google/inject/Binding.html" title="interface in com.google.inject"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?com/google/inject/Binder.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Binder.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>