110 /** 111 * Gets the name of the method represented by this stack frame. 112 * @return the name of the method represented by this stack frame 113 */ 114 public String getMethodName(); 115 116 /** 117 * Gets the declaring {@code Class} for the method represented by 118 * this stack frame. 119 * 120 * @return the declaring {@code Class} of the method represented by 121 * this stack frame 122 * 123 * @throws UnsupportedOperationException if this {@code StackWalker} 124 * is not configured with {@link Option#RETAIN_CLASS_REFERENCE 125 * Option.RETAIN_CLASS_REFERENCE}. 126 */ 127 public Class<?> getDeclaringClass(); 128 129 /** 130 * Returns the name of the source file containing the execution point 131 * represented by this stack frame. Generally, this corresponds 132 * to the {@code SourceFile} attribute of the relevant {@code class} 133 * file as defined by <cite>The Java Virtual Machine Specification</cite>. 134 * In some systems, the name may refer to some source code unit 135 * other than a file, such as an entry in a source repository. 136 * 137 * @return the name of the file containing the execution point 138 * represented by this stack frame, or empty {@code Optional} 139 * is unavailable. 140 * 141 * @jvms 4.7.10 The {@code SourceFile} Attribute 142 */ 143 public Optional<String> getFileName(); 144 145 /** 146 * Returns the line number of the source line containing the execution 147 * point represented by this stack frame. Generally, this is 148 * derived from the {@code LineNumberTable} attribute of the relevant 149 * {@code class} file as defined by <cite>The Java Virtual Machine 150 * Specification</cite>. 151 * 152 * @return the line number of the source line containing the execution 153 * point represented by this stack frame, or empty 154 * {@code Optional} if this information is unavailable. 155 * 156 * @jvms 4.7.12 The {@code LineNumberTable} Attribute 157 */ 158 public OptionalInt getLineNumber(); 159 160 /** 161 * Returns {@code true} if the method containing the execution point 162 * represented by this stack frame is a native method. 163 * 164 * @return {@code true} if the method containing the execution point 165 * represented by this stack frame is a native method. 166 */ 167 public boolean isNativeMethod(); 168 169 /** 170 * Gets a {@code StackTraceElement} for this stack frame. 171 * 172 * @return {@code StackTraceElement} for this stack frame. 173 */ 174 public StackTraceElement toStackTraceElement(); 175 } 176 177 /** 178 * Stack walker option to configure the {@linkplain StackFrame stack frame} 179 * information obtained by a {@code StackWalker}. 180 * | 110 /** 111 * Gets the name of the method represented by this stack frame. 112 * @return the name of the method represented by this stack frame 113 */ 114 public String getMethodName(); 115 116 /** 117 * Gets the declaring {@code Class} for the method represented by 118 * this stack frame. 119 * 120 * @return the declaring {@code Class} of the method represented by 121 * this stack frame 122 * 123 * @throws UnsupportedOperationException if this {@code StackWalker} 124 * is not configured with {@link Option#RETAIN_CLASS_REFERENCE 125 * Option.RETAIN_CLASS_REFERENCE}. 126 */ 127 public Class<?> getDeclaringClass(); 128 129 /** 130 * Returns {@code true} if the method containing the execution point 131 * represented by this stack frame is a native method. 132 * 133 * @return {@code true} if the method containing the execution point 134 * represented by this stack frame is a native method. 135 */ 136 public boolean isNativeMethod(); 137 138 /** 139 * Gets a {@code StackTraceElement} for this stack frame. 140 * 141 * @return {@code StackTraceElement} for this stack frame. 142 */ 143 public StackTraceElement toStackTraceElement(); 144 } 145 146 /** 147 * Stack walker option to configure the {@linkplain StackFrame stack frame} 148 * information obtained by a {@code StackWalker}. 149 * |