|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhg.igd.logging.SourceLocation
This class represents a source code location. It provides access to
class name, method name and the current line number (if possible,
i.e. the source has been compiled using the Java compiler's
-debug option). Instead of a constructor,
detect()
is meant to be called for requesting
the current source location.
Notice: This class is actually obsolete since Java 1.4
provides the java.lang.StackTraceElement
class, but anyway
needed here to ensure compatibility to older Java versions.
Field Summary | |
protected String |
clazz_
The class name |
protected String |
line_
The line number |
protected String |
method_
The method name |
static String |
UNKNOWN
The identifier for an unknown parameter |
Constructor Summary | |
protected |
SourceLocation()
Create a completely unknown SourceLocation object. |
protected |
SourceLocation(String clazz,
String method,
String line)
Create a SourceLocation object. |
Method Summary | |
static SourceLocation |
detect()
Detect the current source code location. |
String |
getClassName()
|
String |
getLineNumber()
|
String |
getMethodName()
|
static String[] |
spallStackTrace(Throwable thrown)
Cut a stacktrace into single lines of text. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String UNKNOWN
protected String clazz_
protected String method_
protected String line_
Constructor Detail |
protected SourceLocation()
SourceLocation
object.
protected SourceLocation(String clazz, String method, String line)
SourceLocation object.
Method Detail |
public static SourceLocation detect()
public String getClassName()
public String getMethodName()
public String getLineNumber()
public static String[] spallStackTrace(Throwable thrown)
thrown
- The stacktrace origin
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |