01: package net.sf.jdec.settings;
02:
03: /*
04: * ExceptionSettings.java Copyright (c) 2006,07 Swaroop Belur
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or (at your option) any later version.
10:
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15:
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19: *
20: */
21:
22: /**
23: * The idea is to control in a single place
24: * how and when/where the exceptions should
25: * be thrown.
26: *
27: * An example would be return some status
28: * instead of throwing an exception from a method.
29: *
30: *
31: *
32: * @author swaroop belur
33: * @since 1.2.1
34: */
35:
36: public class ExceptionSettings {
37:
38: private boolean throwExceptionOnInvalidSourceCodeIndexCheck = true;
39:
40: /**
41: * Make this configurable ...[todo for UI ]
42: */
43: private boolean throwFatalExceptionOnInvalidVariableConfiguration = false;
44:
45: ExceptionSettings() {
46:
47: }
48:
49: public boolean throwExceptionOnInvalidSourceCodeIndexCheck() {
50: return throwExceptionOnInvalidSourceCodeIndexCheck;
51: }
52:
53: public void setThrowExceptionOnInvalidSourceCodeIndexCheck(
54: boolean throwExceptionOnInvalidSourceCodeIndexCheck) {
55: this .throwExceptionOnInvalidSourceCodeIndexCheck = throwExceptionOnInvalidSourceCodeIndexCheck;
56: }
57:
58: public boolean throwFatalExceptionOnInvalidVariableConfiguration() {
59: return throwFatalExceptionOnInvalidVariableConfiguration;
60: }
61:
62: public void setThrowFatalExceptionOnInvalidVariableConfiguration(
63: boolean throwFatalExceptionOnInvalidVariableConfiguration) {
64: this.throwFatalExceptionOnInvalidVariableConfiguration = throwFatalExceptionOnInvalidVariableConfiguration;
65: }
66: }
|