home *** CD-ROM | disk | FTP | other *** search
- package netscape.palomar.util;
-
- import java.util.Date;
-
- public class Warning extends CascadedException {
- private Date _timeStamp = new Date();
-
- public Warning(int id, Exception e) {
- super(id, e);
- }
-
- public Warning(int id) {
- super(id);
- }
-
- public String toString() {
- StringBuffer res = new StringBuffer("Warning: ");
- res.append(((CascadedException)this).getTextForId(super.errorID));
- res.append("\n");
- res.append(this._timeStamp.toString());
- if (super.previous != null) {
- res.append("\n exception caught:\n");
- res.append(super.previous.toString());
- }
-
- return res.toString();
- }
-
- public String getOneLiner() {
- return this._timeStamp.toString() + ": " + ((CascadedException)this).getTextForId(super.errorID);
- }
-
- protected String lookup(int id) {
- switch (id) {
- case 0:
- return "Unspecified Warning ($msg)";
- default:
- return "Warning " + id + " ($msg)";
- }
- }
- }
-