Package com.google.inject.internal.util
Class SourceProvider
- java.lang.Object
-
- com.google.inject.internal.util.SourceProvider
-
public final class SourceProvider extends java.lang.Object
Provides access to the calling line of code.- Author:
- crazybob@google.com (Bob Lee)
-
-
Field Summary
Fields Modifier and Type Field Description static SourceProvider
DEFAULT_INSTANCE
static java.lang.Object
UNKNOWN_SOURCE
Indicates that the source is unknown.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StackTraceElement
getCaller()
Returns the calling line of code.java.lang.Object
getFromClassNames(java.util.List<java.lang.String> moduleClassNames)
Returns the non-skipped module class name.SourceProvider
plusSkippedClasses(java.lang.Class<?>... moreClassesToSkip)
Returns a new instance that also skipsmoreClassesToSkip
.
-
-
-
Field Detail
-
UNKNOWN_SOURCE
public static final java.lang.Object UNKNOWN_SOURCE
Indicates that the source is unknown.
-
DEFAULT_INSTANCE
public static final SourceProvider DEFAULT_INSTANCE
-
-
Method Detail
-
plusSkippedClasses
public SourceProvider plusSkippedClasses(java.lang.Class<?>... moreClassesToSkip)
Returns a new instance that also skipsmoreClassesToSkip
.
-
getCaller
public java.lang.StackTraceElement getCaller()
Returns the calling line of code. The selected line is the nearest to the top of the stack that is not skipped.
-
getFromClassNames
public java.lang.Object getFromClassNames(java.util.List<java.lang.String> moduleClassNames)
Returns the non-skipped module class name.
-
-