com.google.inject.spi
Class DefaultSourceProvider

java.lang.Object
  extended by com.google.inject.spi.DefaultSourceProvider
All Implemented Interfaces:
SourceProvider

public class DefaultSourceProvider
extends java.lang.Object
implements SourceProvider

A source provider which returns ContainerBuilder's caller's StackTraceElement.

Author:
crazybob@google.com (Bob Lee)

Constructor Summary
DefaultSourceProvider()
           
 
Method Summary
 void skipSource(java.lang.Class<?> clazz)
          Instructs the provider to skip the given class in the stack trace when determining the source.
 java.lang.Object source()
          Creates an object pointing to the current location within the configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSourceProvider

public DefaultSourceProvider()
Method Detail

skipSource

public void skipSource(java.lang.Class<?> clazz)
Instructs the provider to skip the given class in the stack trace when determining the source. Use this to keep the container builder from logging utility methods as the sources of bindings (i.e. it will skip to the utility methods' callers instead).

Skipping only takes place after this method is called.


source

public java.lang.Object source()
Description copied from interface: SourceProvider
Creates an object pointing to the current location within the configuration. If we run into a problem later, we'll be able to trace it back to the original source. Useful for debugging.

Specified by:
source in interface SourceProvider