01: /**
02: * $Id: CLIPException.java,v 1.2 2003/12/19 22:46:33 jtb Exp $
03: * Copyright 2003 Sun Microsystems, Inc. All
04: * rights reserved. Use of this product is subject
05: * to license terms. Federal Acquisitions:
06: * Commercial Software -- Government Users
07: * Subject to Standard License Terms and
08: * Conditions.
09: *
10: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
11: * are trademarks or registered trademarks of Sun Microsystems,
12: * Inc. in the United States and other countries.
13: */package com.sun.portal.wsrp.consumer.cli;
14:
15: /**
16: * Exception thrown by the CLIPParser if it fails to parse the
17: * argument array.
18: * <P>
19: * CLIPExceptions have a message and the argument number where
20: * the exception happened.
21: * <P>
22: *
23: *
24: * @author <A HREF="mailto:alejandro.abdelnur@sun.com">Alejandro Abdelnur</A>
25: *
26: */
27: public class CLIPException extends Exception {
28: private int _argumentNumber;
29:
30: /**
31: * Creates a CLIPException.
32: * <P>
33: *
34: * @param msg message for the exception.
35: *
36: * @param argumentNumber argument number where the exception
37: * happened or -1 if not directly related to an argument
38: * number.
39: *
40: */
41: public CLIPException(String msg, int argumentNumber) {
42: super (msg);
43: _argumentNumber = argumentNumber;
44: }
45:
46: /**
47: * Returns the argument number where the exception happened.
48: * <P>
49: *
50: * @return the argument number.
51: *
52: */
53: public int getArgumentNumber() {
54: return _argumentNumber;
55: }
56:
57: /**
58: * String representation for the exception.
59: * <P>
60: *
61: * @return String representation.
62: *
63: */
64: public String toString() {
65: return "CLIP exception - " + getMessage()
66: + ", argument index: " + _argumentNumber;
67: }
68:
69: }
|