Java Stacktrace stackTraceElementWithLinenumberAsString(StackTraceElement stackTraceElement)

Here you can find the source of stackTraceElementWithLinenumberAsString(StackTraceElement stackTraceElement)

Description

stack Trace Element With Linenumber As String

License

Open Source License

Declaration

public static String stackTraceElementWithLinenumberAsString(StackTraceElement stackTraceElement) 

Method Source Code

//package com.java2s;

public class Main {
    /**//  ww  w  .ja va  2 s . c  o  m
     * for the string representation of calling code.
     */
    public static final String LINE_NUMBER_SEPARATOR = "#";

    public static String stackTraceElementWithLinenumberAsString(StackTraceElement stackTraceElement) {
        if (null != stackTraceElement) {
            return stackTraceElement.getClassName() + LINE_NUMBER_SEPARATOR + stackTraceElement.getLineNumber();
        } else {
            return "Internal ERROR stackTraceElement should not be null";
        }
    }
}

Related

  1. stackTraceApproved(StackTraceElement elt, String[] approved)
  2. stackTraceAsString(Throwable t)
  3. stackTraceContainsCause(Throwable throwable, Class searchedCause)
  4. stackTraceElementToString( StackTraceElement element)
  5. stackTraceElementWithLinenumber( StackTraceElement stackTraceElement)
  6. stackTraceEquals(StackTraceElement[] ta1, StackTraceElement[] ta2)
  7. stackTraceGenerate()