49 |
* @author Mark Wielaard (mark@klomp.org) |
* @author Mark Wielaard (mark@klomp.org) |
50 |
* @author Eric Blake (ebb9@email.byu.edu) |
* @author Eric Blake (ebb9@email.byu.edu) |
51 |
* @since 1.4 |
* @since 1.4 |
52 |
* @status updated to 1.4 |
* @status updated to 1.5 |
53 |
*/ |
*/ |
54 |
public final class StackTraceElement implements Serializable |
public final class StackTraceElement implements Serializable |
55 |
{ |
{ |
112 |
} |
} |
113 |
|
|
114 |
/** |
/** |
115 |
|
* Create a new StackTraceElement representing a given source location. |
116 |
|
* |
117 |
|
* @param className the fully qualified name of the class |
118 |
|
* @param methodName the name of the method |
119 |
|
* @param fileName the name of the file, null if unknown |
120 |
|
* @param lineNumber the line in the file, negative if unknown, or -2 |
121 |
|
* if this method is native |
122 |
|
* |
123 |
|
* @since 1.5 |
124 |
|
*/ |
125 |
|
public StackTraceElement(String className, String methodName, String fileName, |
126 |
|
int lineNumber) |
127 |
|
{ |
128 |
|
this(fileName, lineNumber, className, methodName, lineNumber == -2); |
129 |
|
// The public constructor doesn't allow certain values to be null. |
130 |
|
if (className == null || methodName == null) |
131 |
|
throw new NullPointerException("invalid argument to constructor"); |
132 |
|
} |
133 |
|
|
134 |
|
/** |
135 |
* Returns the name of the file, or null if unknown. This is usually |
* Returns the name of the file, or null if unknown. This is usually |
136 |
* obtained from the <code>SourceFile</code> attribute of the class file |
* obtained from the <code>SourceFile</code> attribute of the class file |
137 |
* format, if present. |
* format, if present. |