KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > cowsultants > itracker > ejb > client > exceptions > IssueException


1 /*
2  * This software was designed and created by Jason Carroll.
3  * Copyright (c) 2002, 2003, 2004 Jason Carroll.
4  * The author can be reached at jcarroll@cowsultants.com
5  * ITracker website: http://www.cowsultants.com
6  * ITracker forums: http://www.cowsultants.com/phpBB/index.php
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it only under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  */

18
19 package cowsultants.itracker.ejb.client.exceptions;
20
21
22 /**
23   * This class is used to represent a variety of execptions that can occur
24   * while processing issues.
25   */

26 public class IssueException extends Exception JavaDoc {
27     public static String JavaDoc TYPE_UNKNOWN = "itracker.web.error.system";
28     public static String JavaDoc TYPE_CF_PARSE_NUM = "itracker.web.error.validate.number";
29     public static String JavaDoc TYPE_CF_PARSE_DATE = "itracker.web.error.validate.date";
30     public static String JavaDoc TYPE_CF_REQ_FIELD = "itracker.web.error.validate.required";
31
32     private String JavaDoc type;
33
34     /**
35       * Creates a new IssueException of unknown type.
36       */

37     public IssueException() {
38         type = TYPE_UNKNOWN;
39     }
40
41     /**
42       * Creates a new IssueException of unknown type with a default message.
43       * @param message the exception error message
44       */

45     public IssueException(String JavaDoc message) {
46         super(message);
47         type = TYPE_UNKNOWN;
48     }
49
50     /**
51       * Creates a new IssueException of specified type with a default message.
52       * @param message the exception error message
53       * @param type the exception type represented by a resource bundle key
54       */

55     public IssueException(String JavaDoc message, String JavaDoc type) {
56         super(message);
57         this.type = type;
58     }
59
60     /**
61       * Returns the exception type which can be used to format a localized
62       * error message.
63       * @return String resource bundle key representing the exception type.
64       */

65     public String JavaDoc getType() {
66         return type;
67     }
68
69     /**
70       * Sets the issue exception type.
71       * @param value a String code representing the type of issue exception
72       * that occured.
73       */

74     public void setType(String JavaDoc value) {
75         type = value;
76     }
77 }
78
79   
Popular Tags