Package org.pkl.core

Class StackFrame


  • public final class StackFrame
    extends java.lang.Object
    An element of a Pkl stack trace.
    • Constructor Summary

      Constructors 
      Constructor Description
      StackFrame​(java.lang.String moduleUri, @Nullable java.lang.String memberName, java.util.List<java.lang.String> sourceLines, int startLine, int startColumn, int endLine, int endColumn)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(@Nullable java.lang.Object obj)  
      int getEndColumn()
      Returns the end column number (1-based) corresponding to this frame.
      int getEndLine()
      Returns the end line number (1-based) corresponding to this frame.
      @Nullable java.lang.String getMemberName()
      Returns the qualified name of the property or function corresponding to this frame, if any.
      java.lang.String getModuleUri()
      Returns the module URI to display for this frame.
      java.util.List<java.lang.String> getSourceLines()
      Returns the lines of source code corresponding to this frame.
      int getStartColumn()
      Returns the start column number (1-based) corresponding to this frame.
      int getStartLine()
      Returns the start line number (1-based) corresponding to this frame.
      int hashCode()  
      StackFrame withModuleUri​(java.lang.String moduleUri)
      Returns a copy of this frame with the given module URI.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StackFrame

        public StackFrame​(java.lang.String moduleUri,
                          @Nullable java.lang.String memberName,
                          java.util.List<java.lang.String> sourceLines,
                          int startLine,
                          int startColumn,
                          int endLine,
                          int endColumn)
    • Method Detail

      • getModuleUri

        public java.lang.String getModuleUri()
        Returns the module URI to display for this frame. May not be a syntactically valid URI.
      • withModuleUri

        public StackFrame withModuleUri​(java.lang.String moduleUri)
        Returns a copy of this frame with the given module URI.
      • getMemberName

        public @Nullable java.lang.String getMemberName()
        Returns the qualified name of the property or function corresponding to this frame, if any.
      • getSourceLines

        public java.util.List<java.lang.String> getSourceLines()
        Returns the lines of source code corresponding to this frame. The first line has line number getStartLine(). The last line has line number getEndLine().
      • getStartLine

        public int getStartLine()
        Returns the start line number (1-based) corresponding to this frame.
      • getStartColumn

        public int getStartColumn()
        Returns the start column number (1-based) corresponding to this frame.
      • getEndLine

        public int getEndLine()
        Returns the end line number (1-based) corresponding to this frame.
      • getEndColumn

        public int getEndColumn()
        Returns the end column number (1-based) corresponding to this frame.
      • equals

        public boolean equals​(@Nullable java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object