public class AsyncProviderBinding extends Object implements Binding
AsyncProvider<T>
that generates
the following code for the provider:
return new %provider_name% () { public void get(final AsyncCallback<%object_to_create%> callback) { GWT.runAsync(new RunAsyncCallback() { public void onSuccess() { callback.onSuccess(%provider_of_object_to_create%.get()); } public void onFailure(Throwable ex) { callback.onFailure(ex); } } } }
Modifier and Type | Method and Description |
---|---|
Context |
getContext()
Returns the context in which this binding was created.
|
SourceSnippet |
getCreationStatements(NameGenerator nameGenerator,
List<InjectorMethod> methodsOutput)
Gets one or more fully formed Java statements that create the bound value
and store it in a new local variable named
result . |
Collection<Dependency> |
getDependencies()
Returns the set of dependencies that this binding produces.
|
String |
getGetterMethodPackage()
Returns the package in which the getter for the bound key is created.
|
Collection<TypeLiteral<?>> |
getMemberInjectRequests()
Returns the set of types for which this binding requires member injection methods to be
written.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext, getGetterMethodPackage, getMemberInjectRequests
public SourceSnippet getCreationStatements(NameGenerator nameGenerator, List<InjectorMethod> methodsOutput) throws NoSourceNameException
Binding
result
. If additional
methods are to be created, the given NameGenerator
should be used
to choose their names, and they should be added to methodsOutput
.getCreationStatements
in interface Binding
NoSourceNameException
- if source name is not available for typepublic Collection<Dependency> getDependencies()
Binding
Dependency.GINJECTOR
) as well as dependencies that
this binding needs.getDependencies
in interface Binding
public Context getContext()
Binding
getContext
in interface Binding
public String getGetterMethodPackage()
Binding
GinjectorBindings
objects.
Typically this will be the package containing the type that is returned by the getter, but the only requirement is that it has to be a package where the return type is visible.
getGetterMethodPackage
in interface Binding
public Collection<TypeLiteral<?>> getMemberInjectRequests()
Binding
getMemberInjectRequests
in interface Binding
Copyright © 2008–2018. All rights reserved.