KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > memoire > vainstall > builder > util > VAIBuilderException


1 /*
2  * $RCSfile: VAIBuilderException.java,v $
3  * @modification $Date: 2001/09/28 19:41:42 $
4  * @version $Id: VAIBuilderException.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
5  *
6  */

7
8 package com.memoire.vainstall.builder.util;
9
10 /**
11  * This exception class wraps an Exception and is
12  * able to return its message as formatted HTML.
13  *
14  * @see java.lang.Exception
15  *
16  * @author Henrik Falk
17  * @version $Id: VAIBuilderException.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
18  */

19 public class VAIBuilderException extends Exception JavaDoc {
20
21
22     private String JavaDoc title = "";
23     private String JavaDoc shortMessage = "";
24     private String JavaDoc longMessage = "";
25
26     public VAIBuilderException(String JavaDoc title, String JavaDoc shortMessage, String JavaDoc longMessage) {
27         super(shortMessage);
28         this.title = title;
29         this.shortMessage = shortMessage;
30         this.longMessage = longMessage;
31     }
32
33     public String JavaDoc getMessageAsHtml() {
34
35         String JavaDoc out = "<html><b><font color=black size=2><left>";
36         out += title + " :<br>";
37         out += "<font color=red size=2>"+shortMessage+"</font><br><br>";
38         if (longMessage != null) {
39             out += longMessage;
40         }
41         out += "</left></font></b></html>";
42
43         return out;
44     }
45
46 }
47
Popular Tags