Package com.google.inject.internal.util
Class SourceProvider
- java.lang.Object
-
- com.google.inject.internal.util.SourceProvider
-
public final class SourceProvider extends 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 Object
UNKNOWN_SOURCE
Indicates that the source is unknown.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StackTraceElement
get(StackTraceElement[] stackTraceElements)
Returns the calling line of code.Object
getFromClassNames(List<String> moduleClassNames)
Returns the non-skipped module class name.SourceProvider
plusSkippedClasses(Class<?>... moreClassesToSkip)
Returns a new instance that also skipsmoreClassesToSkip
.
-
-
-
Field Detail
-
UNKNOWN_SOURCE
public static final Object UNKNOWN_SOURCE
Indicates that the source is unknown.
-
DEFAULT_INSTANCE
public static final SourceProvider DEFAULT_INSTANCE
-
-
Method Detail
-
plusSkippedClasses
public SourceProvider plusSkippedClasses(Class<?>... moreClassesToSkip)
Returns a new instance that also skipsmoreClassesToSkip
.
-
get
public StackTraceElement get(StackTraceElement[] stackTraceElements)
Returns the calling line of code. The selected line is the nearest to the top of the stack that is not skipped.
-
-