com.google.inject.spi
Class SourceProviders

java.lang.Object
  extended by com.google.inject.spi.SourceProviders

public class SourceProviders
extends Object

Provides access to the default SourceProvider implementation and common controls for certain implementations.


Field Summary
static Object UNKNOWN_SOURCE
           
 
Method Summary
static Object defaultSource()
          Returns the current source obtained from the default provider.
static Set<String> getSkippedClassNames()
          Gets the set of class names which should be skipped by stacktrace-based providers.
static void skip(Class<?> clazz)
          Instructs stacktrace-based providers to skip the given class in the stack trace when determining the source.
static void withDefault(SourceProvider sourceProvider, Runnable r)
          Sets the default source provider, runs the given command, and then restores the previous default source provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN_SOURCE

public static final Object UNKNOWN_SOURCE
Method Detail

skip

public static void skip(Class<?> clazz)
Instructs stacktrace-based providers to skip the given class in the stack trace when determining the source. Use this to keep the binder 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.


getSkippedClassNames

public static Set<String> getSkippedClassNames()
Gets the set of class names which should be skipped by stacktrace-based providers.


defaultSource

public static Object defaultSource()
Returns the current source obtained from the default provider.


withDefault

public static void withDefault(SourceProvider sourceProvider,
                               Runnable r)
Sets the default source provider, runs the given command, and then restores the previous default source provider.



Copyright 2007 Google Inc. All Rights Reserved.