Package play.inject
Class SourceProvider
- Object
-
- play.inject.SourceProvider
-
public final class SourceProvider extends Object
Provides access to the calling line of code. https://github.com/google/guice/blob/3.0/core/src/com/google/inject/internal/util/SourceProvider.java
-
-
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()
Returns the calling line of code.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
.- Parameters:
moreClassesToSkip
- a list of classes to skip in from source provider.- Returns:
- the source provider skipping
moreClassesToSkip
.
-
get
public StackTraceElement get()
Returns the calling line of code. The selected line is the nearest to the top of the stack that is not skipped.- Returns:
- a stack trace element containing the caller.
-
-