com.google.inject.spi
Class SourceConsumer

java.lang.Object
  extended by com.google.inject.spi.SourceConsumer
Direct Known Subclasses:
ContainerBuilder

public class SourceConsumer
extends java.lang.Object

Support for classes which use source objects.

Author:
crazybob@google.com (Bob Lee)

Constructor Summary
SourceConsumer()
           
 
Method Summary
 SourceProvider getSourceProvider()
          Gets the current source provider.
 void setSourceProvider(SourceProvider sourceProvider)
          Sets the current source provider.
protected  java.lang.Object source()
          Returns the current source.
 void withSourceProvider(SourceProvider sourceProvider, java.lang.Runnable r)
          Sets the source provider, runs the given command, and restores the previous source provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceConsumer

public SourceConsumer()
Method Detail

source

protected java.lang.Object source()
Returns the current source.


getSourceProvider

public SourceProvider getSourceProvider()
Gets the current source provider.


setSourceProvider

public void setSourceProvider(SourceProvider sourceProvider)
Sets the current source provider.


withSourceProvider

public void withSourceProvider(SourceProvider sourceProvider,
                               java.lang.Runnable r)
Sets the source provider, runs the given command, and restores the previous source provider.