com.google.inject.spi
Class SourceProviders

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

public class SourceProviders
extends java.lang.Object

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

Author:
crazybob@google.com (Bob Lee)

Field Summary
static java.lang.Object UNKNOWN_SOURCE
           
 
Method Summary
static java.lang.Object defaultSource()
          Returns the current source obtained from the default provider.
static java.util.Set<java.lang.String> getSkippedClassNames()
          Gets the set of class names which should be skipped by stacktrace-based providers.
static void skip(java.lang.Class<?> clazz)
          Instructs stacktrace-based providers to skip the given class in the stack trace when determining the source.
static void withDefault(SourceProvider sourceProvider, java.lang.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 java.lang.Object UNKNOWN_SOURCE
Method Detail

skip

public static void skip(java.lang.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 java.util.Set<java.lang.String> getSkippedClassNames()
Gets the set of class names which should be skipped by stacktrace-based providers.


defaultSource

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


withDefault

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



Copyright © 2008. All Rights Reserved.