Commit | Line | Data |
---|---|---|
6dd70280 JL |
1 | package com.swabunga.spell.engine;\r |
2 | \r | |
3 | import java.util.ResourceBundle;\r | |
4 | \r | |
5 | /**\r | |
6 | * @author aim4min\r | |
7 | *\r | |
8 | */\r | |
9 | public abstract class Configuration {\r | |
10 | \r | |
11 | public static final String EDIT_DEL1 = "EDIT_DEL1";\r | |
12 | public static final String EDIT_DEL2 = "EDIT_DEL2";\r | |
13 | public static final String EDIT_SWAP = "EDIT_SWAP";\r | |
14 | public static final String EDIT_SUB = "EDIT_SUB";\r | |
15 | public static final String EDIT_SIMILAR = "EDIT_SIMILAR";\r | |
16 | public static final String EDIT_MIN = "EDIT_MIN";\r | |
17 | public static final String EDIT_MAX = "EDIT_MAX";\r | |
18 | \r | |
19 | public static final String SPELL_THRESHOLD = "SPELL_THRESHOLD";\r | |
20 | public static final String SPELL_IGNOREUPPERCASE = "SPELL_IGNOREUPPERCASE";\r | |
21 | public static final String SPELL_IGNOREMIXEDCASE = "SPELL_IGNOREMIXEDCASE";\r | |
22 | public static final String SPELL_IGNOREINTERNETADDRESSES = "SPELL_IGNOREINTERNETADDRESS";\r | |
23 | public static final String SPELL_IGNOREDIGITWORDS = "SPELL_IGNOREDIGITWORDS";\r | |
24 | public static final String SPELL_IGNOREMULTIPLEWORDS = "SPELL_IGNOREMULTIPLEWORDS";\r | |
25 | public static final String SPELL_IGNORESENTANCECAPITALIZATION = "SPELL_IGNORESENTANCECAPTILIZATION";\r | |
26 | \r | |
27 | public abstract int getInteger(String key);\r | |
28 | public abstract boolean getBoolean(String key);\r | |
29 | public abstract void setInteger(String key, int value);\r | |
30 | public abstract void setBoolean(String key, boolean value);\r | |
31 | \r | |
32 | public static final Configuration getConfiguration() {\r | |
33 | Configuration result;\r | |
34 | // changed, breaks applet security otherwise (Howard Kistler)\r | |
35 | String config = (String)null;\r | |
36 | try\r | |
37 | {\r | |
38 | config = System.getProperty("jazzy.config");\r | |
39 | }\r | |
40 | catch(Exception e)\r | |
41 | {\r | |
42 | config = (String)null;\r | |
43 | e.printStackTrace(System.err);\r | |
44 | }\r | |
45 | // End Mod\r | |
46 | if (config != null && config.length() > 0) {\r | |
47 | try {\r | |
48 | result = (Configuration)Class.forName(config).newInstance();\r | |
49 | } catch (InstantiationException e) {\r | |
50 | result = new PropertyConfiguration();\r | |
51 | } catch (IllegalAccessException e) {\r | |
52 | result = new PropertyConfiguration();\r | |
53 | } catch (ClassNotFoundException e) {\r | |
54 | result = new PropertyConfiguration();\r | |
55 | }\r | |
56 | } else {\r | |
57 | result = new PropertyConfiguration(); \r | |
58 | }\r | |
59 | return result;\r | |
60 | }\r | |
61 | }\r |