| <!DOCTYPE html> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| <link rel="shortcut icon" type="image/x-icon" href="../../../favicon.ico" /> |
| <title> |
| |
| Binder |
| |
| |
| | Guice |
| |
| </title> |
| <link href="../../../../javadoc/assets/android-developer-docs.css" rel="stylesheet" type="text/css" /> |
| <link href="../../../../javadoc/assets/customizations.css" rel="stylesheet" type="text/css" /> |
| <script src="../../../../javadoc/assets/search_autocomplete.js" type="text/javascript"></script> |
| <script src="../../../../javadoc/assets/jquery-resizable.min.js" type="text/javascript"></script> |
| <script src="../../../../javadoc/assets/android-developer-docs.js" type="text/javascript"></script> |
| <script src="../../../../javadoc/assets/prettify.js" type="text/javascript"></script> |
| <script type="text/javascript"> |
| setToRoot("../../../", "../../../../javadoc/assets/"); |
| </script> |
| <script src="../../../../javadoc/assets/android-developer-reference.js" type="text/javascript"></script> |
| <script src="../../../../javadoc/assets/navtree_data.js" type="text/javascript"></script> |
| <script src="../../../../javadoc/assets/customizations.js" type="text/javascript"></script> |
| <noscript> |
| <style type="text/css"> |
| html,body{overflow:auto;} |
| #body-content{position:relative; top:0;} |
| #doc-content{overflow:visible;border-left:3px solid #666;} |
| #side-nav{padding:0;} |
| #side-nav .toggle-list ul {display:block;} |
| #resize-packages-nav{border-bottom:3px solid #666;} |
| </style> |
| </noscript> |
| </head> |
| |
| <body class="Guice_1.0"> |
| |
| <div id="header"> |
| <div id="headerLeft"> |
| |
| <span id="masthead-title">Guice</span> |
| |
| </div> |
| <div id="headerRight"> |
| |
| <div id="search" > |
| <div id="searchForm"> |
| <form accept-charset="utf-8" class="gsc-search-box" |
| onsubmit="return submit_search()"> |
| <table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody> |
| <tr> |
| <td class="gsc-input"> |
| <input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off" |
| title="search developer docs" name="q" |
| value="search developer docs" |
| onFocus="search_focus_changed(this, true)" |
| onBlur="search_focus_changed(this, false)" |
| onkeydown="return search_changed(event, true, '../../../')" |
| onkeyup="return search_changed(event, false, '../../../')" /> |
| <div id="search_filtered_div" class="no-display"> |
| <table id="search_filtered" cellspacing=0> |
| </table> |
| </div> |
| </td> |
| <td class="gsc-search-button"> |
| <input type="submit" value="Search" title="search" id="search-button" class="gsc-search-button" /> |
| </td> |
| <td class="gsc-clear-button"> |
| <div title="clear results" class="gsc-clear-button"> </div> |
| </td> |
| </tr></tbody> |
| </table> |
| </form> |
| </div><!-- searchForm --> |
| </div><!-- search --> |
| |
| |
| <div id="api-level-toggle"> |
| <input type="checkbox" id="apiLevelCheckbox" onclick="toggleApiLevelSelector(this)" /> |
| <label for="apiLevelCheckbox" class="disabled">Filter by API Level: </label> |
| <select id="apiLevelSelector"> |
| <!-- option elements added by buildApiLevelSelector() --> |
| </select> |
| </div> |
| <script> |
| var SINCE_DATA = [ 'Guice_1.0', 'Guice_2.0' ]; |
| |
| var SINCE_LABELS = [ 'Guice_1.0', 'Guice_2.0' ]; |
| buildApiLevelSelector(); |
| addLoadEvent(changeApiLevel); |
| </script> |
| |
| |
| |
| </div> |
| </div><!-- header --> |
| |
| |
| <div class="g-section g-tpl-240" id="body-content"> |
| <div class="g-unit g-first side-nav-resizable" id="side-nav"> |
| <div id="swapper"> |
| <div id="nav-panels"> |
| <div id="resize-packages-nav"> |
| <div id="packages-nav"> |
| <div id="index-links"><nobr> |
| <a href="../../../packages.html" >Package Index</a> | |
| <a href="../../../classes.html" >Class Index</a></nobr> |
| </div> |
| <ul> |
| |
| <li class="selected api apilevel-Guice_1.0"> |
| <a href="../../../com/google/inject/package-summary.html">com.google.inject</a></li> |
| <li class="api apilevel-Guice_2.0"> |
| <a href="../../../com/google/inject/assistedinject/package-summary.html">com.google.inject.assistedinject</a></li> |
| <li class="api apilevel-Guice_1.0"> |
| <a href="../../../com/google/inject/binder/package-summary.html">com.google.inject.binder</a></li> |
| <li class="api apilevel-Guice_1.0"> |
| <a href="../../../com/google/inject/jndi/package-summary.html">com.google.inject.jndi</a></li> |
| <li class="api apilevel-Guice_1.0"> |
| <a href="../../../com/google/inject/matcher/package-summary.html">com.google.inject.matcher</a></li> |
| <li class="api apilevel-Guice_2.0"> |
| <a href="../../../com/google/inject/multibindings/package-summary.html">com.google.inject.multibindings</a></li> |
| <li class="api apilevel-Guice_1.0"> |
| <a href="../../../com/google/inject/name/package-summary.html">com.google.inject.name</a></li> |
| <li class="api apilevel-Guice_1.0"> |
| <a href="../../../com/google/inject/spi/package-summary.html">com.google.inject.spi</a></li> |
| <li class="api apilevel-Guice_2.0"> |
| <a href="../../../com/google/inject/throwingproviders/package-summary.html">com.google.inject.throwingproviders</a></li> |
| <li class="api apilevel-Guice_1.0"> |
| <a href="../../../com/google/inject/tools/jmx/package-summary.html">com.google.inject.tools.jmx</a></li> |
| <li class="api apilevel-Guice_2.0"> |
| <a href="../../../com/google/inject/util/package-summary.html">com.google.inject.util</a></li> |
| </ul><br/> |
| </div> <!-- end packages --> |
| </div> <!-- end resize-packages --> |
| <div id="classes-nav"> |
| <ul> |
| |
| <li><h2>Interfaces</h2> |
| <ul> |
| <li class="selected api apilevel-Guice_1.0"><a href="../../../com/google/inject/Binder.html">Binder</a></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Binding.html">Binding</a><T></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Injector.html">Injector</a></li> |
| <li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/MembersInjector.html">MembersInjector</a><T></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Module.html">Module</a></li> |
| <li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/PrivateBinder.html">PrivateBinder</a></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Provider.html">Provider</a><T></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Scope.html">Scope</a></li> |
| </ul> |
| </li> |
| |
| <li><h2>Classes</h2> |
| <ul> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/AbstractModule.html">AbstractModule</a></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Guice.html">Guice</a></li> |
| <li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/InjectorBuilder.html">InjectorBuilder</a></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Key.html">Key</a><T></li> |
| <li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/PrivateModule.html">PrivateModule</a></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Scopes.html">Scopes</a></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a><T></li> |
| </ul> |
| </li> |
| |
| <li><h2>Annotations</h2> |
| <ul> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/BindingAnnotation.html">BindingAnnotation</a></li> |
| <li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/Exposed.html">Exposed</a></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/ImplementedBy.html">ImplementedBy</a></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Inject.html">Inject</a></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/ProvidedBy.html">ProvidedBy</a></li> |
| <li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/Provides.html">Provides</a></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/ScopeAnnotation.html">ScopeAnnotation</a></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Singleton.html">Singleton</a></li> |
| </ul> |
| </li> |
| |
| <li><h2>Enums</h2> |
| <ul> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Stage.html">Stage</a></li> |
| </ul> |
| </li> |
| |
| <li><h2>Exceptions</h2> |
| <ul> |
| <li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/ConfigurationException.html">ConfigurationException</a></li> |
| <li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/CreationException.html">CreationException</a></li> |
| <li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/OutOfScopeException.html">OutOfScopeException</a></li> |
| <li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/ProvisionException.html">ProvisionException</a></li> |
| </ul> |
| </li> |
| |
| </ul><br/> |
| </div><!-- end classes --> |
| </div><!-- end nav-panels --> |
| <div id="nav-tree" style="display:none"> |
| <div id="index-links"><nobr> |
| <a href="../../../packages.html" >Package Index</a> | |
| <a href="../../../classes.html" >Class Index</a></nobr> |
| </div> |
| </div><!-- end nav-tree --> |
| </div><!-- end swapper --> |
| </div> <!-- end side-nav --> |
| <script> |
| if (!isMobile) { |
| $("<a href='#' id='nav-swap' onclick='swapNav();return false;' style='font-size:10px;line-height:9px;margin-left:1em;text-decoration:none;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>").appendTo("#side-nav"); |
| chooseDefaultNav(); |
| if ($("#nav-tree").is(':visible')) { |
| init_default_navtree("../../../"); |
| } else { |
| addLoadEvent(function() { |
| scrollIntoView("packages-nav"); |
| scrollIntoView("classes-nav"); |
| }); |
| } |
| $("#swapper").css({borderBottom:"2px solid #aaa"}); |
| } else { |
| swapNav(); // tree view should be used on mobile |
| } |
| </script> |
| |
| |
| |
| <div class="g-unit" id="doc-content"> |
| |
| <div id="api-info-block"> |
| |
| |
| |
| |
| <div class="sum-details-links"> |
| |
| Summary: |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="#pubmethods">Methods</a> |
| |
| |
| |
| |
| | <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a> |
| |
| </div><!-- end sum-details-links --> |
| <div class="api-level"> |
| |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a> |
| |
| |
| |
| |
| |
| </div> |
| </div><!-- end api-info-block --> |
| |
| |
| <!-- ======== START OF CLASS DATA ======== --> |
| |
| <div id="jd-header"> |
| public |
| |
| |
| |
| interface |
| <h1>Binder</h1> |
| |
| |
| |
| |
| |
| |
| |
| |
| </div><!-- end header --> |
| |
| <div id="naMessage"></div> |
| |
| <div id="jd-content" class="api apilevel-Guice_1.0"> |
| <table class="jd-inheritance-table"> |
| |
| |
| <tr> |
| |
| <td colspan="1" class="jd-inheritance-class-cell">com.google.inject.Binder</td> |
| </tr> |
| |
| |
| </table> |
| |
| |
| |
| |
| |
| |
| <table class="jd-sumtable jd-sumtable-subclasses"><tr><td colspan="12" style="border:none;margin:0;padding:0;"> |
| |
| <a href="#" onclick="return toggleInherited(this, null)" id="subclasses-indirect" class="jd-expando-trigger closed" |
| ><img id="subclasses-indirect-trigger" |
| src="../../../../javadoc/assets/images/triangle-closed.png" |
| class="jd-expando-trigger-img" /></a>Known Indirect Subclasses |
| |
| <div id="subclasses-indirect"> |
| <div id="subclasses-indirect-list" |
| class="jd-inheritedlinks" |
| |
| > |
| |
| |
| <a href="../../../com/google/inject/PrivateBinder.html">PrivateBinder</a> |
| |
| |
| </div> |
| <div id="subclasses-indirect-summary" |
| style="display: none;" |
| > |
| <table class="jd-sumtable-expando"> |
| <tr class="alt-color api apilevel-Guice_2.0" > |
| <td class="jd-linkcol"><a href="../../../com/google/inject/PrivateBinder.html">PrivateBinder</a></td> |
| <td class="jd-descrcol" width="100%">Returns a binder whose configuration information is hidden from its environment by default. </td> |
| </tr> |
| </table> |
| </div> |
| </div> |
| </td></tr></table> |
| |
| |
| <div class="jd-descr"> |
| |
| |
| <h2>Class Overview</h2> |
| <p>Collects configuration information (primarily <i>bindings</i>) which will be |
| used to create an <code><a href="../../../com/google/inject/Injector.html">Injector</a></code>. Guice provides this object to your |
| application's <code><a href="../../../com/google/inject/Module.html">Module</a></code> 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 |
| <code><a href="../../../com/google/inject/AbstractModule.html">AbstractModule</a></code>. |
| |
| <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 <code><a href="../../../com/google/inject/Module.html">Module</a></code> 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 |
| <code><a href="../../../com/google/inject/ImplementedBy.html">@ImplementedBy</a></code> or <code><a href="../../../com/google/inject/ProvidedBy.html">@ProvidedBy</a></code> |
| 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<Service></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 |
| <code><a href="../../../com/google/inject/Provider.html#get()">get()</a></code> on the resulting Provider instance to obtain the |
| <code>Service</code> instance. |
| |
| <p>The <code><a href="../../../com/google/inject/Provider.html">Provider</a></code> 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 <code><a href="../../../com/google/inject/Scope.html">scopes</a></code> 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 <code><a href="../../../com/google/inject/Singleton.html">Singleton</a></code>/<code><a href="../../../com/google/inject/Scopes.html#SINGLETON">SINGLETON</a></code>, 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<PaymentService<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<CreditCard></code>. The class |
| <code>CreditCardPaymentService</code> must implement the |
| <code>PaymentService<CreditCard></code> interface. Guice cannot currently bind or |
| inject a generic type, such as <code>Set<E></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 <code><a href="../../../com/google/inject/Injector.html">Injector</a></code> 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 <code><a href="null#valueOf(java.lang.Class<T>, java.lang.String)">all enums</a></code>, and to |
| <code><a href="null#forName(java.lang.String)">class literals</a></code>. Conversions for other types can be |
| configured using <code><a href="../../../com/google/inject/Binder.html#convertToTypes(com.google.inject.matcher.Matcher<? super com.google.inject.TypeLiteral<?>>, com.google.inject.spi.TypeConverter)">convertToTypes()</a></code>. |
| |
| <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, <code><a href="../../../com/google/inject/name/Named.html">@Named</a></code>. 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. |
| |
| <pre> |
| Constructor<T> loneCtor = getLoneCtorFromServiceImplViaReflection(); |
| bind(ServiceImpl.class) |
| .toConstructor(loneCtor);</pre> |
| |
| In this example, we directly tell Guice which constructor to use in a concrete |
| class implementation. It means that we do not need to place @Inject |
| on any of the constructors and that Guice treats the provided constructor as though |
| it were annotated so. It is useful for cases where you cannot modify existing |
| classes and is a bit simpler than using a <code><a href="../../../com/google/inject/Provider.html">Provider</a></code>. |
| |
| <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 <code><a href="../../../com/google/inject/Binder.html#bindScope(java.lang.Class<? extends java.lang.annotation.Annotation>, com.google.inject.Scope)">bindScope(Class<? extends Annotation>, Scope)</a></code>, |
| <code><a href="../../../com/google/inject/Binder.html#bindInterceptor(com.google.inject.matcher.Matcher<? super java.lang.Class<?>>, com.google.inject.matcher.Matcher<? super java.lang.reflect.Method>, org.aopalliance.intercept.MethodInterceptor...)">bindInterceptor(Matcher<? super Class<?>>, Matcher<? super Method>, org.aopalliance.intercept.MethodInterceptor...)</a></code>, <code><a href="../../../com/google/inject/Binder.html#install(com.google.inject.Module)">install(Module)</a></code>, <code><a href="../../../com/google/inject/Binder.html#requestStaticInjection(java.lang.Class<?>...)">requestStaticInjection(Class<?>...)</a></code>, |
| <code><a href="../../../com/google/inject/Binder.html#addError(java.lang.String, java.lang.Object...)">addError(String, Object...)</a></code> and <code><a href="../../../com/google/inject/Binder.html#currentStage()">currentStage()</a></code> are not part of the Binding EDSL; |
| you can learn how to use these in the usual way, from the method |
| documentation.</p> |
| |
| |
| |
| |
| |
| </div><!-- jd-descr --> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <div class="jd-descr"> |
| |
| |
| <h2>Summary</h2> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <!-- ========== METHOD SUMMARY =========== --> |
| <table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> |
| |
| |
| |
| |
| <tr class="alt-color api apilevel-Guice_2.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| void</nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#addError(com.google.inject.spi.Message)">addError</a></span>(<a href="../../../com/google/inject/spi/Message.html">Message</a> message)</nobr> |
| |
| <div class="jd-descrdiv">Records an error message to be presented to the user at a later time.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class=" api apilevel-Guice_1.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| void</nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#addError(java.lang.String, java.lang.Object...)">addError</a></span>(String message, Object... arguments)</nobr> |
| |
| <div class="jd-descrdiv">Records an error message which will be presented to the user at a later |
| time.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class="alt-color api apilevel-Guice_1.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| void</nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#addError(java.lang.Throwable)">addError</a></span>(Throwable t)</nobr> |
| |
| <div class="jd-descrdiv">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.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class=" api apilevel-Guice_1.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| <T> |
| <a href="../../../com/google/inject/binder/LinkedBindingBuilder.html">LinkedBindingBuilder</a><T></nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#bind(com.google.inject.Key<T>)">bind</a></span>(<a href="../../../com/google/inject/Key.html">Key</a><T> key)</nobr> |
| |
| <div class="jd-descrdiv">See the EDSL examples at <code><a href="../../../com/google/inject/Binder.html">Binder</a></code>.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class="alt-color api apilevel-Guice_1.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| <T> |
| <a href="../../../com/google/inject/binder/AnnotatedBindingBuilder.html">AnnotatedBindingBuilder</a><T></nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#bind(com.google.inject.TypeLiteral<T>)">bind</a></span>(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a><T> typeLiteral)</nobr> |
| |
| <div class="jd-descrdiv">See the EDSL examples at <code><a href="../../../com/google/inject/Binder.html">Binder</a></code>.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class=" api apilevel-Guice_1.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| <T> |
| <a href="../../../com/google/inject/binder/AnnotatedBindingBuilder.html">AnnotatedBindingBuilder</a><T></nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#bind(java.lang.Class<T>)">bind</a></span>(Class<T> type)</nobr> |
| |
| <div class="jd-descrdiv">See the EDSL examples at <code><a href="../../../com/google/inject/Binder.html">Binder</a></code>.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class="alt-color api apilevel-Guice_1.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| <a href="../../../com/google/inject/binder/AnnotatedConstantBindingBuilder.html">AnnotatedConstantBindingBuilder</a></nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#bindConstant()">bindConstant</a></span>()</nobr> |
| |
| <div class="jd-descrdiv">See the EDSL examples at <code><a href="../../../com/google/inject/Binder.html">Binder</a></code>.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class=" api apilevel-Guice_2.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| void</nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#bindInterceptor(com.google.inject.matcher.Matcher<? super java.lang.Class<?>>, com.google.inject.matcher.Matcher<? super java.lang.reflect.Method>, org.aopalliance.intercept.MethodInterceptor...)">bindInterceptor</a></span>(<a href="../../../com/google/inject/matcher/Matcher.html">Matcher</a><? super Class<?>> classMatcher, <a href="../../../com/google/inject/matcher/Matcher.html">Matcher</a><? super Method> methodMatcher, MethodInterceptor... interceptors)</nobr> |
| |
| <div class="jd-descrdiv">Binds method interceptor[s] to methods matched by class and method matchers.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class="alt-color api apilevel-Guice_2.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| void</nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#bindListener(com.google.inject.matcher.Matcher<? super com.google.inject.TypeLiteral<?>>, com.google.inject.spi.TypeListener)">bindListener</a></span>(<a href="../../../com/google/inject/matcher/Matcher.html">Matcher</a><? super <a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a><?>> typeMatcher, <a href="../../../com/google/inject/spi/TypeListener.html">TypeListener</a> listener)</nobr> |
| |
| <div class="jd-descrdiv">Registers a listener for injectable types.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class=" api apilevel-Guice_1.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| void</nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#bindScope(java.lang.Class<? extends java.lang.annotation.Annotation>, com.google.inject.Scope)">bindScope</a></span>(Class<? extends Annotation> annotationType, <a href="../../../com/google/inject/Scope.html">Scope</a> scope)</nobr> |
| |
| <div class="jd-descrdiv">Binds a scope to an annotation.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class="alt-color api apilevel-Guice_2.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| void</nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#convertToTypes(com.google.inject.matcher.Matcher<? super com.google.inject.TypeLiteral<?>>, com.google.inject.spi.TypeConverter)">convertToTypes</a></span>(<a href="../../../com/google/inject/matcher/Matcher.html">Matcher</a><? super <a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a><?>> typeMatcher, <a href="../../../com/google/inject/spi/TypeConverter.html">TypeConverter</a> converter)</nobr> |
| |
| <div class="jd-descrdiv">Binds a type converter.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class=" api apilevel-Guice_1.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| <a href="../../../com/google/inject/Stage.html">Stage</a></nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#currentStage()">currentStage</a></span>()</nobr> |
| |
| <div class="jd-descrdiv">Gets the current stage.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class="alt-color api apilevel-Guice_2.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| <T> |
| <a href="../../../com/google/inject/MembersInjector.html">MembersInjector</a><T></nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#getMembersInjector(com.google.inject.TypeLiteral<T>)">getMembersInjector</a></span>(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a><T> typeLiteral)</nobr> |
| |
| <div class="jd-descrdiv">Returns the members injector used to inject dependencies into methods and fields on instances |
| of the given type <code>T</code>.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class=" api apilevel-Guice_2.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| <T> |
| <a href="../../../com/google/inject/MembersInjector.html">MembersInjector</a><T></nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#getMembersInjector(java.lang.Class<T>)">getMembersInjector</a></span>(Class<T> type)</nobr> |
| |
| <div class="jd-descrdiv">Returns the members injector used to inject dependencies into methods and fields on instances |
| of the given type <code>T</code>.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class="alt-color api apilevel-Guice_2.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| <T> |
| <a href="../../../com/google/inject/Provider.html">Provider</a><T></nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#getProvider(com.google.inject.Key<T>)">getProvider</a></span>(<a href="../../../com/google/inject/Key.html">Key</a><T> key)</nobr> |
| |
| <div class="jd-descrdiv">Returns the provider used to obtain instances for the given injection key.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class=" api apilevel-Guice_2.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| <T> |
| <a href="../../../com/google/inject/Provider.html">Provider</a><T></nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#getProvider(java.lang.Class<T>)">getProvider</a></span>(Class<T> type)</nobr> |
| |
| <div class="jd-descrdiv">Returns the provider used to obtain instances for the given injection type.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class="alt-color api apilevel-Guice_1.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| void</nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#install(com.google.inject.Module)">install</a></span>(<a href="../../../com/google/inject/Module.html">Module</a> module)</nobr> |
| |
| <div class="jd-descrdiv">Uses the given module to configure more bindings.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class=" api apilevel-Guice_2.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| <a href="../../../com/google/inject/PrivateBinder.html">PrivateBinder</a></nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#newPrivateBinder()">newPrivateBinder</a></span>()</nobr> |
| |
| <div class="jd-descrdiv">Creates a new private child environment for bindings and other configuration.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class="alt-color api apilevel-Guice_2.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| <T> |
| void</nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#requestInjection(com.google.inject.TypeLiteral<T>, T)">requestInjection</a></span>(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a><T> type, T instance)</nobr> |
| |
| <div class="jd-descrdiv">Upon successful creation, the <code><a href="../../../com/google/inject/Injector.html">Injector</a></code> will inject instance fields |
| and methods of the given object.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class=" api apilevel-Guice_2.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| void</nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#requestInjection(java.lang.Object)">requestInjection</a></span>(Object instance)</nobr> |
| |
| <div class="jd-descrdiv">Upon successful creation, the <code><a href="../../../com/google/inject/Injector.html">Injector</a></code> will inject instance fields |
| and methods of the given object.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class="alt-color api apilevel-Guice_1.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| void</nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#requestStaticInjection(java.lang.Class<?>...)">requestStaticInjection</a></span>(Class...<?> types)</nobr> |
| |
| <div class="jd-descrdiv">Upon successful creation, the <code><a href="../../../com/google/inject/Injector.html">Injector</a></code> will inject static fields |
| and methods in the given classes.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class=" api apilevel-Guice_2.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| <a href="../../../com/google/inject/Binder.html">Binder</a></nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#skipSources(java.lang.Class...)">skipSources</a></span>(Class... classesToSkip)</nobr> |
| |
| <div class="jd-descrdiv">Returns a binder that skips <code>classesToSkip</code> when identify the |
| calling code.</div> |
| |
| </td></tr> |
| |
| |
| |
| <tr class="alt-color api apilevel-Guice_2.0" > |
| <td class="jd-typecol"><nobr> |
| abstract |
| |
| |
| |
| |
| <a href="../../../com/google/inject/Binder.html">Binder</a></nobr> |
| </td> |
| <td class="jd-linkcol" width="100%"><nobr> |
| <span class="sympad"><a href="../../../com/google/inject/Binder.html#withSource(java.lang.Object)">withSource</a></span>(Object source)</nobr> |
| |
| <div class="jd-descrdiv">Returns a binder that uses <code>source</code> as the reference location for |
| configuration errors.</div> |
| |
| </td></tr> |
| |
| |
| |
| </table> |
| |
| |
| |
| |
| |
| |
| |
| </div><!-- jd-descr (summary) --> |
| |
| <!-- Details --> |
| |
| |
| |
| |
| |
| |
| |
| |
| <!-- XML Attributes --> |
| |
| |
| <!-- Enum Values --> |
| |
| |
| <!-- Constants --> |
| |
| |
| <!-- Fields --> |
| |
| |
| <!-- Public ctors --> |
| |
| |
| |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <!-- Protected ctors --> |
| |
| |
| |
| <!-- ========= METHOD DETAIL ======== --> |
| <!-- Public methdos --> |
| |
| <h2>Public Methods</h2> |
| |
| |
| |
| <A NAME="addError(com.google.inject.spi.Message)"></A> |
| |
| <div class="jd-details api apilevel-Guice_2.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| void |
| </span> |
| <span class="sympad">addError</span> |
| <span class="normal">(<a href="../../../com/google/inject/spi/Message.html">Message</a> message)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>Records an error message to be presented to the user at a later time.</p></div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="addError(java.lang.String, java.lang.Object...)"></A> |
| |
| <div class="jd-details api apilevel-Guice_1.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| void |
| </span> |
| <span class="sympad">addError</span> |
| <span class="normal">(String message, Object... arguments)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>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 <code><a href="null#format(java.lang.String, java.lang.Object...)">format(String, Object[])</a></code> to insert the arguments into the |
| message. |
| </p></div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="addError(java.lang.Throwable)"></A> |
| |
| <div class="jd-details api apilevel-Guice_1.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| void |
| </span> |
| <span class="sympad">addError</span> |
| <span class="normal">(Throwable t)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>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></div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="bind(com.google.inject.Key<T>)"></A> |
| |
| <div class="jd-details api apilevel-Guice_1.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| <a href="../../../com/google/inject/binder/LinkedBindingBuilder.html">LinkedBindingBuilder</a><T> |
| </span> |
| <span class="sympad">bind</span> |
| <span class="normal">(<a href="../../../com/google/inject/Key.html">Key</a><T> key)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>See the EDSL examples at <code><a href="../../../com/google/inject/Binder.html">Binder</a></code>. |
| </p></div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="bind(com.google.inject.TypeLiteral<T>)"></A> |
| |
| <div class="jd-details api apilevel-Guice_1.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| <a href="../../../com/google/inject/binder/AnnotatedBindingBuilder.html">AnnotatedBindingBuilder</a><T> |
| </span> |
| <span class="sympad">bind</span> |
| <span class="normal">(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a><T> typeLiteral)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>See the EDSL examples at <code><a href="../../../com/google/inject/Binder.html">Binder</a></code>. |
| </p></div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="bind(java.lang.Class<T>)"></A> |
| |
| <div class="jd-details api apilevel-Guice_1.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| <a href="../../../com/google/inject/binder/AnnotatedBindingBuilder.html">AnnotatedBindingBuilder</a><T> |
| </span> |
| <span class="sympad">bind</span> |
| <span class="normal">(Class<T> type)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>See the EDSL examples at <code><a href="../../../com/google/inject/Binder.html">Binder</a></code>. |
| </p></div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="bindConstant()"></A> |
| |
| <div class="jd-details api apilevel-Guice_1.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| <a href="../../../com/google/inject/binder/AnnotatedConstantBindingBuilder.html">AnnotatedConstantBindingBuilder</a> |
| </span> |
| <span class="sympad">bindConstant</span> |
| <span class="normal">()</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>See the EDSL examples at <code><a href="../../../com/google/inject/Binder.html">Binder</a></code>. |
| </p></div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="bindInterceptor(com.google.inject.matcher.Matcher<? super java.lang.Class<?>>, com.google.inject.matcher.Matcher<? super java.lang.reflect.Method>, org.aopalliance.intercept.MethodInterceptor...)"></A> |
| |
| <div class="jd-details api apilevel-Guice_2.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| void |
| </span> |
| <span class="sympad">bindInterceptor</span> |
| <span class="normal">(<a href="../../../com/google/inject/matcher/Matcher.html">Matcher</a><? super Class<?>> classMatcher, <a href="../../../com/google/inject/matcher/Matcher.html">Matcher</a><? super Method> methodMatcher, MethodInterceptor... interceptors)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>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></div> |
| <div class="jd-tagdata"> |
| <h5 class="jd-tagtitle">Parameters</h5> |
| <table class="jd-tagtable"> |
| <tr> |
| <th>classMatcher</td> |
| <td>matches classes the interceptor should apply to. For |
| example: <code>only(Runnable.class)</code>.</td> |
| </tr> |
| <tr> |
| <th>methodMatcher</td> |
| <td>matches methods the interceptor should apply to. For |
| example: <code>annotatedWith(Transactional.class)</code>.</td> |
| </tr> |
| <tr> |
| <th>interceptors</td> |
| <td>to bind |
| </td> |
| </tr> |
| </table> |
| </div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="bindListener(com.google.inject.matcher.Matcher<? super com.google.inject.TypeLiteral<?>>, com.google.inject.spi.TypeListener)"></A> |
| |
| <div class="jd-details api apilevel-Guice_2.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| void |
| </span> |
| <span class="sympad">bindListener</span> |
| <span class="normal">(<a href="../../../com/google/inject/matcher/Matcher.html">Matcher</a><? super <a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a><?>> typeMatcher, <a href="../../../com/google/inject/spi/TypeListener.html">TypeListener</a> listener)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>Registers a listener for injectable types. Guice will notify the listener when it encounters |
| injectable types matched by the given type matcher.</p></div> |
| <div class="jd-tagdata"> |
| <h5 class="jd-tagtitle">Parameters</h5> |
| <table class="jd-tagtable"> |
| <tr> |
| <th>typeMatcher</td> |
| <td>that matches injectable types the listener should be notified of</td> |
| </tr> |
| <tr> |
| <th>listener</td> |
| <td>for injectable types matched by typeMatcher</td> |
| </tr> |
| </table> |
| </div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="bindScope(java.lang.Class<? extends java.lang.annotation.Annotation>, com.google.inject.Scope)"></A> |
| |
| <div class="jd-details api apilevel-Guice_1.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| void |
| </span> |
| <span class="sympad">bindScope</span> |
| <span class="normal">(Class<? extends Annotation> annotationType, <a href="../../../com/google/inject/Scope.html">Scope</a> scope)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>Binds a scope to an annotation. |
| </p></div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="convertToTypes(com.google.inject.matcher.Matcher<? super com.google.inject.TypeLiteral<?>>, com.google.inject.spi.TypeConverter)"></A> |
| |
| <div class="jd-details api apilevel-Guice_2.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| void |
| </span> |
| <span class="sympad">convertToTypes</span> |
| <span class="normal">(<a href="../../../com/google/inject/matcher/Matcher.html">Matcher</a><? super <a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a><?>> typeMatcher, <a href="../../../com/google/inject/spi/TypeConverter.html">TypeConverter</a> converter)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>Binds a type converter. The injector will use the given converter to |
| convert string constants to matching types as needed.</p></div> |
| <div class="jd-tagdata"> |
| <h5 class="jd-tagtitle">Parameters</h5> |
| <table class="jd-tagtable"> |
| <tr> |
| <th>typeMatcher</td> |
| <td>matches types the converter can handle</td> |
| </tr> |
| <tr> |
| <th>converter</td> |
| <td>converts values</td> |
| </tr> |
| </table> |
| </div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="currentStage()"></A> |
| |
| <div class="jd-details api apilevel-Guice_1.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| <a href="../../../com/google/inject/Stage.html">Stage</a> |
| </span> |
| <span class="sympad">currentStage</span> |
| <span class="normal">()</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>Gets the current stage. |
| </p></div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="getMembersInjector(com.google.inject.TypeLiteral<T>)"></A> |
| |
| <div class="jd-details api apilevel-Guice_2.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| <a href="../../../com/google/inject/MembersInjector.html">MembersInjector</a><T> |
| </span> |
| <span class="sympad">getMembersInjector</span> |
| <span class="normal">(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a><T> typeLiteral)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>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 |
| <code><a href="../../../com/google/inject/Injector.html">Injector</a></code> has been created. The members injector will throw an <code>IllegalStateException</code> if you try to use it beforehand.</p></div> |
| <div class="jd-tagdata"> |
| <h5 class="jd-tagtitle">Parameters</h5> |
| <table class="jd-tagtable"> |
| <tr> |
| <th>typeLiteral</td> |
| <td>type to get members injector for</td> |
| </tr> |
| </table> |
| </div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="getMembersInjector(java.lang.Class<T>)"></A> |
| |
| <div class="jd-details api apilevel-Guice_2.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| <a href="../../../com/google/inject/MembersInjector.html">MembersInjector</a><T> |
| </span> |
| <span class="sympad">getMembersInjector</span> |
| <span class="normal">(Class<T> type)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>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 |
| <code><a href="../../../com/google/inject/Injector.html">Injector</a></code> has been created. The members injector will throw an <code>IllegalStateException</code> if you try to use it beforehand.</p></div> |
| <div class="jd-tagdata"> |
| <h5 class="jd-tagtitle">Parameters</h5> |
| <table class="jd-tagtable"> |
| <tr> |
| <th>type</td> |
| <td>type to get members injector for</td> |
| </tr> |
| </table> |
| </div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="getProvider(com.google.inject.Key<T>)"></A> |
| |
| <div class="jd-details api apilevel-Guice_2.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| <a href="../../../com/google/inject/Provider.html">Provider</a><T> |
| </span> |
| <span class="sympad">getProvider</span> |
| <span class="normal">(<a href="../../../com/google/inject/Key.html">Key</a><T> key)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>Returns the provider used to obtain instances for the given injection key. |
| The returned provider will not be valid until the <code><a href="../../../com/google/inject/Injector.html">Injector</a></code> has been |
| created. The provider will throw an <code>IllegalStateException</code> if you |
| try to use it beforehand.</p></div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="getProvider(java.lang.Class<T>)"></A> |
| |
| <div class="jd-details api apilevel-Guice_2.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| <a href="../../../com/google/inject/Provider.html">Provider</a><T> |
| </span> |
| <span class="sympad">getProvider</span> |
| <span class="normal">(Class<T> type)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>Returns the provider used to obtain instances for the given injection type. |
| The returned provider will not be valid until the <code><a href="../../../com/google/inject/Injector.html">Injector</a></code> has been |
| created. The provider will throw an <code>IllegalStateException</code> if you |
| try to use it beforehand.</p></div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="install(com.google.inject.Module)"></A> |
| |
| <div class="jd-details api apilevel-Guice_1.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| void |
| </span> |
| <span class="sympad">install</span> |
| <span class="normal">(<a href="../../../com/google/inject/Module.html">Module</a> module)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>Uses the given module to configure more bindings. |
| </p></div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="newPrivateBinder()"></A> |
| |
| <div class="jd-details api apilevel-Guice_2.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| <a href="../../../com/google/inject/PrivateBinder.html">PrivateBinder</a> |
| </span> |
| <span class="sympad">newPrivateBinder</span> |
| <span class="normal">()</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>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 <code><a href="../../../com/google/inject/PrivateModule.html">PrivateModule</a></code> for details.</p></div> |
| <div class="jd-tagdata"> |
| <h5 class="jd-tagtitle">Returns</h5> |
| <ul class="nolist"><li>a binder that inherits configuration from this binder. Only exposed configuration on |
| the returned binder will be visible to this binder.</li></ul> |
| </div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="requestInjection(com.google.inject.TypeLiteral<T>, T)"></A> |
| |
| <div class="jd-details api apilevel-Guice_2.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| void |
| </span> |
| <span class="sympad">requestInjection</span> |
| <span class="normal">(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a><T> type, T instance)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>Upon successful creation, the <code><a href="../../../com/google/inject/Injector.html">Injector</a></code> will inject instance fields |
| and methods of the given object.</p></div> |
| <div class="jd-tagdata"> |
| <h5 class="jd-tagtitle">Parameters</h5> |
| <table class="jd-tagtable"> |
| <tr> |
| <th>type</td> |
| <td>of instance</td> |
| </tr> |
| <tr> |
| <th>instance</td> |
| <td>for which members will be injected</td> |
| </tr> |
| </table> |
| </div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="requestInjection(java.lang.Object)"></A> |
| |
| <div class="jd-details api apilevel-Guice_2.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| void |
| </span> |
| <span class="sympad">requestInjection</span> |
| <span class="normal">(Object instance)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>Upon successful creation, the <code><a href="../../../com/google/inject/Injector.html">Injector</a></code> will inject instance fields |
| and methods of the given object.</p></div> |
| <div class="jd-tagdata"> |
| <h5 class="jd-tagtitle">Parameters</h5> |
| <table class="jd-tagtable"> |
| <tr> |
| <th>instance</td> |
| <td>for which members will be injected</td> |
| </tr> |
| </table> |
| </div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="requestStaticInjection(java.lang.Class<?>...)"></A> |
| |
| <div class="jd-details api apilevel-Guice_1.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| void |
| </span> |
| <span class="sympad">requestStaticInjection</span> |
| <span class="normal">(Class...<?> types)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>Upon successful creation, the <code><a href="../../../com/google/inject/Injector.html">Injector</a></code> will inject static fields |
| and methods in the given classes.</p></div> |
| <div class="jd-tagdata"> |
| <h5 class="jd-tagtitle">Parameters</h5> |
| <table class="jd-tagtable"> |
| <tr> |
| <th>types</td> |
| <td>for which static members will be injected |
| </td> |
| </tr> |
| </table> |
| </div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="skipSources(java.lang.Class...)"></A> |
| |
| <div class="jd-details api apilevel-Guice_2.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| <a href="../../../com/google/inject/Binder.html">Binder</a> |
| </span> |
| <span class="sympad">skipSources</span> |
| <span class="normal">(Class... classesToSkip)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>Returns a binder that skips <code>classesToSkip</code> when identify the |
| calling code. The caller's StackTraceElement is used to locate |
| the source of configuration errors.</p></div> |
| <div class="jd-tagdata"> |
| <h5 class="jd-tagtitle">Parameters</h5> |
| <table class="jd-tagtable"> |
| <tr> |
| <th>classesToSkip</td> |
| <td>library classes that create bindings on behalf of |
| their clients.</td> |
| </tr> |
| </table> |
| </div> |
| <div class="jd-tagdata"> |
| <h5 class="jd-tagtitle">Returns</h5> |
| <ul class="nolist"><li>a binder that shares its configuration with this binder.</li></ul> |
| </div> |
| |
| </div> |
| </div> |
| |
| |
| <A NAME="withSource(java.lang.Object)"></A> |
| |
| <div class="jd-details api apilevel-Guice_2.0"> |
| <h4 class="jd-details-title"> |
| <span class="normal"> |
| public |
| |
| |
| abstract |
| |
| <a href="../../../com/google/inject/Binder.html">Binder</a> |
| </span> |
| <span class="sympad">withSource</span> |
| <span class="normal">(Object source)</span> |
| </h4> |
| <div class="api-level"> |
| <div> |
| |
| Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a> |
| |
| </div> |
| |
| |
| |
| </div> |
| <div class="jd-details-descr"> |
| |
| <div class="jd-tagdata jd-tagdescr"><p>Returns a binder that uses <code>source</code> as the reference location for |
| configuration errors. This is typically a StackTraceElement |
| for <code>.java</code> source but it could any binding source, such as the |
| path to a <code>.properties</code> file.</p></div> |
| <div class="jd-tagdata"> |
| <h5 class="jd-tagtitle">Parameters</h5> |
| <table class="jd-tagtable"> |
| <tr> |
| <th>source</td> |
| <td>any object representing the source location and has a |
| concise <code><a href="null#toString()">toString()</a></code> value</td> |
| </tr> |
| </table> |
| </div> |
| <div class="jd-tagdata"> |
| <h5 class="jd-tagtitle">Returns</h5> |
| <ul class="nolist"><li>a binder that shares its configuration with this binder</li></ul> |
| </div> |
| |
| </div> |
| </div> |
| |
| |
| |
| |
| |
| <!-- ========= METHOD DETAIL ======== --> |
| |
| |
| |
| <!-- ========= END OF CLASS DATA ========= --> |
| <A NAME="navbar_top"></A> |
| |
| <div id="footer"> |
| Generated by <a href="http://code.google.com/p/doclava/">Doclava</a>. |
| </div> <!-- end footer --> |
| |
| </div> <!-- jd-content --> |
| |
| </div><!-- end doc-content --> |
| |
| </div> <!-- end body-content --> |
| |
| <script type="text/javascript"> |
| init(); /* initialize android-developer-docs.js */ |
| </script> |
| |
| </body> |
| </html> |