1 package net.sf.crispy; 2 3 import java.io.Serializable; 4 5 /** 6 * Wrapper for java.lang.StackTraceElement, so you can ist transport from the server to the client side. 7 * 8 * @author Linke 9 * @since 1.1.0 10 * 11 */ 12 public final class StackTraceElementWrapper implements Serializable { 13 14 private static final long serialVersionUID = 6249331607491652074L; 15 16 private String className = null; 17 private String methodName = null; 18 private String fileName = null; 19 private int lineNumber = -1; 20 private boolean nativeMethod = false; 21 22 public StackTraceElementWrapper() { } 23 24 public StackTraceElementWrapper(StackTraceElement pvStackTraceElement) { 25 setClassName(pvStackTraceElement.getClassName()); 26 setMethodName(pvStackTraceElement.getMethodName()); 27 setFileName(pvStackTraceElement.getFileName()); 28 setLineNumber(pvStackTraceElement.getLineNumber()); 29 setNativeMethod(pvStackTraceElement.isNativeMethod()); 30 } 31 32 public String getClassName() { return className; } 33 public void setClassName(String pvClassName) { className = pvClassName; } 34 35 public String getFileName() { return fileName; } 36 public void setFileName(String pvFileName) { fileName = pvFileName; } 37 38 public int getLineNumber() { return lineNumber; } 39 public void setLineNumber(int pvLineNumber) { lineNumber = pvLineNumber; } 40 41 public String getMethodName() { return methodName; } 42 public void setMethodName(String pvMethodName) { methodName = pvMethodName; } 43 44 public boolean isNativeMethod() { return nativeMethod; } 45 public void setNativeMethod(boolean pvNativeMethod) { nativeMethod = pvNativeMethod; } 46 public boolean getNativeMethod() { return nativeMethod; } 47 48 49 public String toString() { 50 return getClassName() + "." + getMethodName() + " (" + getFileName() + ":" + getLineNumber() + ")"; 51 } 52 53 }