StackTraceElement class in Java

java.lang.StackTraceElement

An element in a stack trace, as returned by Throwable.getStackTrace(). Each element represents a single stack frame.

All stack frames except for the one at the top of the stack represent a method invocation.

The frame at the top of the stack represents the execution point at which the stack trace was generated. Typically, this is the point at which the throwable corresponding to the stack trace was created.

Some methods of StackTraceElement class

StackTraceElement(String, String, String, int)This method creates a stack trace element representing the specified execution point. The module name and module version of the stack trace element will be null.

StackTraceElement(String, String, String, String, String, String, int)This method creates a stack trace element representing the specified execution point.

equals(Object)This method returns true if the specified object is another StackTraceElement instance representing the same execution point as this instance.

getClassLoaderName()This method returns the name of the class loader of the class containing the execution point represented by this stack trace element.

getClassName()This method returns the fully qualified name of the class containing the execution point represented by this stack trace element.

getFileName()This method returns the name of the source file containing the execution point represented by this stack trace element.

getLineNumber()This method returns the line number of the source line containing the execution point represented by this stack trace element.

getMethodName()This method returns the name of the method containing the execution point represented by this stack trace element.

getModuleName()This method returns the module name of the module containing the execution point represented by this stack trace element.

getModuleVersion()This method returns the module version of the module containing the execution point represented by this stack trace element.

hashCode()This method returns a hash code value for this stack trace element.

isNativeMethod()This method returns true if the method containing the execution point represented by this stack trace element is a native method.

toString()This method returns a string representation of this stack trace element.

No comments:

Post a Comment