Source code: com/clra/member/ValidationException.java
1 package com.clra.member;
2
3 /**
4 * Indicates data has failed validation rules. The accessor <tt>getType()</tt>
5 * indicates what type of data has failed validation.
6 *
7 * @version $Id: ValidationException.java,v 1.2 2002/02/18 18:03:31 rphall Exp $
8 * @author <a href="mailto:rphall@pluto.njcc.com">Rick Hall</a>
9 */
10 public class ValidationException extends Exception {
11
12 public final static int MEMBER_ID = 0;
13 public final static int MEMBER_ACCOUNT_NAME = 1;
14 public final static int MEMBER_ACCOUNT_PASSWORD = 2;
15 public final static int MEMBER_CLRA_STATUS = 3;
16 public final static int MEMBER_NAME = 4;
17 public final static int MEMBER_NAME_FIRST = 5;
18 public final static int MEMBER_NAME_LAST = 6;
19 public final static int MEMBER_EMAIL = 7;
20 public final static int MEMBER_TELEPHONE_NUMBER = 8;
21 public final static int MEMBER_TELEPHONE_COLLECTION = 9;
22 public final static int MEMBER_ADDRESS = 10;
23 public final static int MEMBER_ADDRESS_STREET1 = 11;
24 public final static int MEMBER_ADDRESS_STREET2 = 12;
25 public final static int MEMBER_ADDRESS_CITY = 13;
26 public final static int MEMBER_ADDRESS_STATE = 14;
27 public final static int MEMBER_ADDRESS_ZIP = 15;
28 public final static int MEMBER_CLRA_YEAR = 16;
29 public final static int MEMBER_BIRTH = 17;
30
31 private final static int LOWER = MEMBER_ID;
32 private final static int UPPER = MEMBER_BIRTH;
33
34 private final int type;
35
36 public ValidationException( int type ) {
37 super();
38 this.type = type;
39 if ( type < LOWER || type > UPPER ) {
40 throw new IllegalArgumentException( "invalid type == " + type );
41 }
42 } // ctor(int)
43
44 public ValidationException( int type, String devMsg ) {
45 super( devMsg );
46 this.type = type;
47 if ( type < LOWER || type > UPPER ) {
48 throw new IllegalArgumentException( "invalid type == " + type );
49 }
50 } // ctor(int,String)
51
52 public int getType() {
53 return this.type;
54 }
55
56 } // ValidationException
57
58 /*
59 * $Log: ValidationException.java,v $
60 * Revision 1.2 2002/02/18 18:03:31 rphall
61 * Ran dos2unix to remove ^M (carriage return) from end of lines
62 *
63 * Revision 1.1.1.1 2002/01/03 21:57:28 rphall
64 * Initial load, 5th try, Jan-03-2002 4:57 PM
65 *
66 * Revision 1.1 2001/11/10 16:17:34 rphall
67 * First compilable version
68 *
69 */
70