01: // ***************************************************************
02: // * *
03: // * File:CLIPException.java *
04: // * *
05: // * Copyright (c) 2001 Sun Microsystems, Inc. *
06: // * All rights reserved. *
07: // * *
08: // * *
09: // * Date - Dec/12/2001 *
10: // * Author - alejandro.abdelnur@sun.com *
11: // * *
12: // ***************************************************************
13:
14: package com.sun.portal.common.clip;
15:
16: /**
17: * Exception thrown by the CLIPParser if it fails to parse the
18: * argument array.
19: * <P>
20: * CLIPExceptions have a message and the argument number where
21: * the exception happened.
22: * <P>
23: *
24: *
25: * @author <A HREF="mailto:alejandro.abdelnur@sun.com">Alejandro Abdelnur</A>
26: *
27: */
28: public class CLIPException extends Exception {
29: private int _argumentNumber;
30:
31: /**
32: * Creates a CLIPException.
33: * <P>
34: *
35: * @param msg message for the exception.
36: *
37: * @param argumentNumber argument number where the exception
38: * happened or -1 if not directly related to an argument
39: * number.
40: *
41: */
42: public CLIPException(String msg, int argumentNumber) {
43: super (msg);
44: _argumentNumber = argumentNumber;
45: }
46:
47: /**
48: * Returns the argument number where the exception happened.
49: * <P>
50: *
51: * @return the argument number.
52: *
53: */
54: public int getArgumentNumber() {
55: return _argumentNumber;
56: }
57:
58: /**
59: * String representation for the exception.
60: * <P>
61: *
62: * @return String representation.
63: *
64: */
65: public String toString() {
66: return "CLIP exception - " + getMessage()
67: + ", argument index: " + _argumentNumber;
68: }
69:
70: }
|