Module java.base
Package java.lang

Interface StackWalker.StackFrame

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      int getByteCodeIndex()
      Returns the index to the code array of the Code attribute containing the execution point represented by this stack frame.
      String getClassName()
      Gets the binary name of the declaring class of the method represented by this stack frame.
      Class<?> getDeclaringClass()
      Gets the declaring Class for the method represented by this stack frame.
      default String getDescriptor()
      Returns the descriptor of the method represented by this stack frame as defined by The Java Virtual Machine Specification.
      String getFileName()
      Returns the name of the source file containing the execution point represented by this stack frame.
      int getLineNumber()
      Returns the line number of the source line containing the execution point represented by this stack frame.
      String getMethodName()
      Gets the name of the method represented by this stack frame.
      default MethodType getMethodType()
      Returns the MethodType representing the parameter types and the return type for the method represented by this stack frame.
      boolean isNativeMethod()
      Returns true if the method containing the execution point represented by this stack frame is a native method.
      StackTraceElement toStackTraceElement()
      Gets a StackTraceElement for this stack frame.
    • Method Detail

      • getClassName

        String getClassName()
        Gets the binary name of the declaring class of the method represented by this stack frame.
        Returns:
        the binary name of the declaring class of the method represented by this stack frame
      • getMethodName

        String getMethodName()
        Gets the name of the method represented by this stack frame.
        Returns:
        the name of the method represented by this stack frame
      • getByteCodeIndex

        int getByteCodeIndex()
        Returns the index to the code array of the Code attribute containing the execution point represented by this stack frame. The code array gives the actual bytes of Java Virtual Machine code that implement the method.
        Returns:
        the index to the code array of the Code attribute containing the execution point represented by this stack frame, or a negative number if the method is native.
      • getFileName

        String getFileName()
        Returns the name of the source file containing the execution point represented by this stack frame. Generally, this corresponds to the SourceFile attribute of the relevant class file as defined by The Java Virtual Machine Specification. In some systems, the name may refer to some source code unit other than a file, such as an entry in a source repository.
        Returns:
        the name of the file containing the execution point represented by this stack frame, or null if this information is unavailable.
      • getLineNumber

        int getLineNumber()
        Returns the line number of the source line containing the execution point represented by this stack frame. Generally, this is derived from the LineNumberTable attribute of the relevant class file as defined by The Java Virtual Machine Specification.
        Returns:
        the line number of the source line containing the execution point represented by this stack frame, or a negative number if this information is unavailable.
      • isNativeMethod

        boolean isNativeMethod()
        Returns true if the method containing the execution point represented by this stack frame is a native method.
        Returns:
        true if the method containing the execution point represented by this stack frame is a native method.
      • toStackTraceElement

        StackTraceElement toStackTraceElement()
        Gets a StackTraceElement for this stack frame.
        Returns:
        StackTraceElement for this stack frame.