KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > IrresolveableArgumentException


1 /*****************************************************************************
2  * Copyright (C) Codehaus.org. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  *****************************************************************************/

8 /*
9  * Created on Feb 28, 2005
10  *
11  * Author Ben Yu
12  * ZBS
13  */

14 package jfun.yan;
15
16 import jfun.util.Misc;
17
18 /**
19  * Represents an exception when a parameter of a component cannot be resolved.
20  * <p>
21  * Codehaus.org.
22  *
23  * @author Ben Yu
24  *
25  */

26 public class IrresolveableArgumentException extends UnsatisfiedComponentException {
27   private final int num;
28   private final Class JavaDoc type;
29   /**
30    * Get the ordinal position of the parameter.
31    * @return the ordinal position of the parameter.
32    */

33   public int getOrdinalPosition() {
34     return num;
35   }
36   /**
37    * Get the expected parameter type.
38    * @return the parameter type.
39    */

40   public Class JavaDoc getParameterType() {
41     return type;
42   }
43   /**
44    * Create an IrresolveableArgumentException object.
45    * @param ckey the component key.
46    * @param num the ordinal position of the parameter.
47    * @param type the type of the parameter.
48    */

49   public IrresolveableArgumentException(final Object JavaDoc ckey, final int num,
50       final Class JavaDoc type) {
51     super(ckey, "The #" + num + " argument of type "
52         +Misc.getTypeName(type) + " for component <" + ckey
53         + "> is not resolveable");
54     this.num = num;
55     this.type = type;
56   }
57 }
58
Popular Tags