RuntimePermission relates to Java's security mechanism and is not examined further here.
The Throwable class supports Java's exception-handling system and is the class from which
all exception classes are derived. It is discussed in Chapter 10.
SecurityManager is a class that your classes can subclass to create a security manager.
Generally, you don't need to implement your own security manager. If you do, you need
to consult the documentation that comes with your Java development system.
The StackTraceElement class describes a single stack frame, which is an individual element
of a stack trace when an exception occurs. Each stack frame represents an execution point,
which includes such things as the name of the class, the name of the method, the name of
the file, and the source-code line number. An array of StackTraceElements is returned by
the getStackTrace( ) method of the Throwable class.
StackTraceElement has one constructor:
StackTraceElement(String className, String methName, string fileName, int line)
Here, the name of the class is specified by className, the name of the method is specified in
methName, the name of the file is specified by fileName, and the line number is passed in line.
If there is no valid line number, use a negative value for line. Furthermore, a value of 2 for
line indicates that this frame refers to a native method.
The methods supported by StackTraceElement are shown in Table 16-20. These
methods give you programmatic access to a stack trace.
boolean equals(Object ob)
Returns true if the invoking StackTraceElement is the same as the
one passed in ob. Other wise, it returns false.
String getClassName( )
Returns the class name of the execution point described by the
invoking StackTraceElement.
String getFileName( )
Returns the filename of the execution point described by the
invoking StackTraceElement.
TABLE 16-20
The Methods Defined by StackTraceElement
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks