Class SourceLocationUtils
java.lang.Object
software.amazon.smithy.rulesengine.language.util.SourceLocationUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic SourceLocationReturns the source code location of the caller.static StringstackTraceForm(SourceLocation sourceLocation) Prints a source location in "stack trace form": `filename:linenumber`.
-
Method Details
-
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
Prints a source location in "stack trace form": `filename:linenumber`.- Parameters:
sourceLocation- Source location to print- Returns:
- formatted source location
-