4 * Copyright 2004-2007 MTBJ, Inc.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 package com
.dtrules
.session
;
21 * ICompilerError defines a linked list of errors generated when compiling
22 * a decision table. The error types are:
27 * 4 -- InitialAction <br>
34 public interface ICompilerError
{
36 enum Type
{ CONDITION
, ACTION
, TABLE
, INITIALACTION
, CONTEXT
};
39 * Returns the Error type, which will be a 1 if the error was in the
40 * compilation of a Condition, a 2 if the error was in the compliation
41 * of an Action, or a 3 if it was in building the Table.
42 * @return ErrorTypeNumber
46 * Returns the text provided the compiler which generated the error. If
47 * the error type is a 3, this function returns null.
48 * @return Source code of error
52 * Returns an error message explaining the error.
53 * @return message explaining the error
57 * Returns the index (1 based) of the condition that triggered the error.
58 * Returns a value > 0 if compling a condition caused the error, and a
59 * zero otherwise. Error types 2 and 3 will always return zero.
60 * @return index of condition
62 int getConditionIndex();
64 * Returns the index (1 based) of the action that triggered the error.
65 * Returns a value > 0 if compling an action caused the error, and a zero
66 * otherwise. Error types 1 and 3 will always return zero.
67 * @return index of action
71 * Really, we should toss the getConditionIndex and getActionIndex in
72 * favor of a getIndex which returns a 1 or greater for valid indexes,
73 * and a zero otherwise. Use the errorType to decide if this is an
74 * index into InitialActions, Conditions, or Actions.
78 * If the error was due to an unbalanced decision table, this funciton
79 * returns the row in the condition table where the error was detected.
80 * @return row index of error
84 * If the error was due to an unbalanced decision table, this funciton
85 * returns the column in the condition table where the error was detected.
86 * @return column index of error