Class SourceLocationUtils
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.util.SourceLocationUtils
-
public final class SourceLocationUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SourceLocationjavaLocation()Returns the source code location of the caller.static java.lang.StringstackTraceForm(SourceLocation sourceLocation)Prints a source location in "stack trace form": `filename:linenumber`.
-
-
-
Method Detail
-
javaLocation
public static SourceLocation javaLocation()
Returns the source code location of the caller. This is very helpful when determining where rules generated from Java-based builders originated.Library-local and JDK stack frames are discarded. If no relevant location can be found, `SourceLocation.none()` is returned.
- Returns:
- The SourceLocation.
-
stackTraceForm
public static java.lang.String stackTraceForm(SourceLocation sourceLocation)
Prints a source location in "stack trace form": `filename:linenumber`.- Parameters:
sourceLocation- Source location to print- Returns:
- formatted source location
-
-