📄 wrongformatexception.java
字号:
package net.betterjava.sample.xml.bind;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.lang.IndexOutOfBoundsException;
/**
* An customerized exception, throwed when input data string
* is not valid. Application may hope to catch this exception
* to continue the next transformation.
*/
public class WrongFormatException extends Exception {
private Exception source;
public WrongFormatException(IndexOutOfBoundsException e) {
super(e.getMessage());
this.source = e;
}
public String getMessage() {
return super.getMessage();
}
public void printStackTrace(PrintStream ps) {
ps.println("Nested Exception");
this.source.printStackTrace(ps);
super.printStackTrace(ps);
}
public void printStackTrace(PrintWriter pw) {
pw.println("Nested Exception");
this.source.printStackTrace(pw);
super.printStackTrace(pw);
}
/**
* Returns a String that represents the value of this object.
* @return a string representation of the receiver
*/
public String toString() {
// Insert code to print the receiver here.
// This implementation forwards the message to super. You may replace or supplement this.
return super.toString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -