KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jxl > biff > formula > FormulaException


1 /*********************************************************************
2 *
3 * Copyright (C) 2002 Andrew Khan
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 ***************************************************************************/

19
20 package jxl.biff.formula;
21
22 import jxl.JXLException;
23
24 /**
25  * Exception thrown when parsing a formula
26  */

27 public class FormulaException extends JXLException
28 {
29   private static class FormulaMessage
30   {
31     /**
32      * The message
33      */

34     public String JavaDoc message;
35     /**
36      * Constructs this exception with the specified message
37      *
38      * @param m the message
39      */

40     FormulaMessage(String JavaDoc m) {message = m;}
41   }
42
43   /**
44    */

45   static FormulaMessage unrecognizedToken =
46     new FormulaMessage("Unrecognized token");
47
48   /**
49    */

50   static FormulaMessage unrecognizedFunction =
51     new FormulaMessage("Unrecognized function");
52
53   /**
54    */

55   public static FormulaMessage biff8Supported =
56     new FormulaMessage("Only biff8 formulas are supported");
57
58   static FormulaMessage lexicalError =
59     new FormulaMessage("Lexical error: ");
60
61   static FormulaMessage incorrectArguments =
62     new FormulaMessage("Incorrect arguments supplied to function");
63
64   static FormulaMessage sheetRefNotFound =
65     new FormulaMessage("Could not find sheet");
66
67   static FormulaMessage cellNameNotFound =
68     new FormulaMessage("Could not find named cell");
69
70
71   /**
72    * Constructs this exception with the specified message
73    *
74    * @param m the message
75    */

76   public FormulaException(FormulaMessage m)
77   {
78     super(m.message);
79   }
80
81   /**
82    * Constructs this exception with the specified message
83    *
84    * @param m the message
85    */

86   public FormulaException(FormulaMessage m, int val)
87   {
88     super(m.message + " " + val);
89   }
90
91   /**
92    * Constructs this exception with the specified message
93    *
94    * @param m the message
95    */

96   public FormulaException(FormulaMessage m, String JavaDoc val)
97   {
98     super(m.message + " " + val);
99   }
100 }
101
102
103
104
105
106
Popular Tags