com.google.gwt.inject.rebind.binding
Class ParentBinding

java.lang.Object
  extended by com.google.gwt.inject.rebind.binding.ParentBinding
All Implemented Interfaces:
Binding

public class ParentBinding
extends java.lang.Object
implements Binding

Binding that represents a value inherited from higher in the injector hierarchy. TODO(bchambers): It would be nice if we didn't need to have the creator/parent paradigm for parent and child bindings, but it is the easiest way to add this to Gin.


Method Summary
 Context getContext()
          Returns the context in which this binding was created.
 SourceSnippet getCreationStatements(NameGenerator nameGenerator, java.util.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.
 java.util.Collection<Dependency> getDependencies()
          Returns the set of dependencies that this binding produces.
 java.lang.String getGetterMethodPackage()
          The getter must be placed in the same package as the parent getter, to ensure that its return type is visible.
 java.util.Collection<TypeLiteral<?>> getMemberInjectRequests()
          Returns the set of types for which this binding requires member injection methods to be written.
 GinjectorBindings getParentBindings()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gwt.inject.rebind.binding.Binding
getContext, getMemberInjectRequests
 

Method Detail

getGetterMethodPackage

public java.lang.String getGetterMethodPackage()
The getter must be placed in the same package as the parent getter, to ensure that its return type is visible.

Specified by:
getGetterMethodPackage in interface Binding

getParentBindings

public GinjectorBindings getParentBindings()

getCreationStatements

public SourceSnippet getCreationStatements(NameGenerator nameGenerator,
                                           java.util.List<InjectorMethod> methodsOutput)
                                    throws NoSourceNameException
Description copied from interface: Binding
Gets one or more fully formed Java statements that create the bound value and store it in a new local variable named 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.

Specified by:
getCreationStatements in interface Binding
Throws:
NoSourceNameException - if source name is not available for type

getDependencies

public java.util.Collection<Dependency> getDependencies()
Description copied from interface: Binding
Returns the set of dependencies that this binding produces. This contains edges coming into the key that this type binds (from Dependency.GINJECTOR) as well as dependencies that this binding needs.

Specified by:
getDependencies in interface Binding

getContext

public Context getContext()
Description copied from interface: Binding
Returns the context in which this binding was created.

Specified by:
getContext in interface Binding

getMemberInjectRequests

public java.util.Collection<TypeLiteral<?>> getMemberInjectRequests()
Description copied from interface: Binding
Returns the set of types for which this binding requires member injection methods to be written.

Specified by:
getMemberInjectRequests in interface Binding