< prev index next >

src/java.base/share/classes/java/lang/StackWalker.java

Print this page




  83  * constructor or method in this {@code StackWalker} class
  84  * will cause a {@link NullPointerException NullPointerException}
  85  * to be thrown.
  86  *
  87  * @since 9
  88  */
  89 public final class StackWalker {
  90     /**
  91      * A {@code StackFrame} object represents a method invocation returned by
  92      * {@link StackWalker}.
  93      *
  94      * <p> The {@link #getDeclaringClass()} method may be unsupported as determined
  95      * by the {@linkplain Option stack walking options} of a {@linkplain
  96      * StackWalker stack walker}.
  97      *
  98      * @since 9
  99      * @jvms 2.6
 100      */
 101     public interface StackFrame {
 102         /**
 103          * Gets the <a href="ClassLoader.html#name">binary name</a>
 104          * of the declaring class of the method represented by this stack frame.
 105          *
 106          * @return the binary name of the declaring class of the method
 107          *         represented by this stack frame
 108          *
 109          * @jls 13.1 The Form of a Binary
 110          */
 111         public String getClassName();
 112 
 113         /**
 114          * Gets the name of the method represented by this stack frame.
 115          * @return the name of the method represented by this stack frame
 116          */
 117         public String getMethodName();
 118 
 119         /**
 120          * Gets the declaring {@code Class} for the method represented by
 121          * this stack frame.
 122          *
 123          * @return the declaring {@code Class} of the method represented by




  83  * constructor or method in this {@code StackWalker} class
  84  * will cause a {@link NullPointerException NullPointerException}
  85  * to be thrown.
  86  *
  87  * @since 9
  88  */
  89 public final class StackWalker {
  90     /**
  91      * A {@code StackFrame} object represents a method invocation returned by
  92      * {@link StackWalker}.
  93      *
  94      * <p> The {@link #getDeclaringClass()} method may be unsupported as determined
  95      * by the {@linkplain Option stack walking options} of a {@linkplain
  96      * StackWalker stack walker}.
  97      *
  98      * @since 9
  99      * @jvms 2.6
 100      */
 101     public interface StackFrame {
 102         /**
 103          * Gets the <a href="ClassLoader.html#binary-name">binary name</a>
 104          * of the declaring class of the method represented by this stack frame.
 105          *
 106          * @return the binary name of the declaring class of the method
 107          *         represented by this stack frame
 108          *
 109          * @jls 13.1 The Form of a Binary
 110          */
 111         public String getClassName();
 112 
 113         /**
 114          * Gets the name of the method represented by this stack frame.
 115          * @return the name of the method represented by this stack frame
 116          */
 117         public String getMethodName();
 118 
 119         /**
 120          * Gets the declaring {@code Class} for the method represented by
 121          * this stack frame.
 122          *
 123          * @return the declaring {@code Class} of the method represented by


< prev index next >