1 /**
2 */
3 package net.sf.layoutParser.exception;
4
5 /**
6 * This enum should have all the messages contained in the bundled exception properties files. <br/>
7 * It holds only the key name of each entry, and it's used to retrieve the messages from the files. <br/>
8 *
9 * @author Mário Valentim Junior
10 * @since 1.0
11 * @date 12/06/2008
12 */
13 public enum ExceptionKey {
14
15 BUNDLE_NAME("ExceptionsBundle"),
16
17 /**
18 * Error parsing {0} against schema.
19 */
20 SCHEMA_CHECK("schema.check"),
21
22 /**
23 * Could not load file {0}.
24 */
25 FILE_NOT_FOUND("fileNotFound"),
26
27 /**
28 * Could not parse file {0}.
29 */
30 PARSE_FILE("parse.file"),
31
32 /**
33 * Could not parse mask using xpath query: {0}.
34 */
35 PARSE_MASK("parse.mask"),
36
37 /**
38 * Could not parse alias using xpath query: {0}.
39 */
40 PARSE_ALIAS("parse.alias"),
41
42 /**
43 * Could not parse layout using xpath query: {0}.
44 */
45 PARSE_LAYOUT("parse.layout"),
46
47 /**
48 * Could not parse plugin using xpath query: {0}.
49 */
50 PARSE_PLUGIN("parse.plugin"),
51
52 /**
53 * Could not load class for the plugin {0}.
54 */
55 PLUGIN_CLASS_NOT_FOUND("plugin.classNotFound"),
56
57 /**
58 * Could not find plugin for type {0} of entry {1}.
59 */
60 PLUGIN_CLASS_NOT_FOUND_FOR_ENTRY("plugin.classNotFoundforEntry"),
61
62 /**
63 * Error instantiating the plugin class {0}.
64 */
65 PLUGIN_INSTANTIATION("plugin.instantiation"),
66
67 /**
68 * Could not load class {0} for the alias {1}.
69 */
70 ALIAS_CLASS_NOT_FOUND("alias.classNotFound"),
71
72 /**
73 * Could not load class {0} for item {1}.
74 */
75 ITEM_CLASS_NOT_FOUND("item.classNotFound"),
76
77 /**
78 * Value ({0}) is bigger then expected for item {1}. Expected {2} but was {3}.
79 */
80 ITEM_DATA_TOO_BIG("item.tooBigForField"),
81
82 /**
83 * "There is no class associated with layout {0}. Layout class is mandatory if you want auto discovery of item types."
84 */
85 LAYOUT_NO_CLASS_DEFINED("layout.noClassDefined"),
86
87 /**
88 * "The class {0} associated with layout {1} couldn't be loaded."
89 */
90 LAYOUT_CLASS_NOT_FOUND("layout.classNotFound"),
91
92 /**
93 * "Could not read data being parsed to item {0}."
94 */
95 LAYOUT_READ_DATA("layout.readData"),
96
97 /**
98 * "The type {0} associated with item {1} is not a instance of java.util.Collection."
99 */
100 ITEM_NOT_COLLECTION("item.notCollection"),
101
102 /**
103 * "No format informed on item {0}. Type {1} always must have a format declared on the xml."
104 */
105 PLUGIN_NO_FORMAT("plugin.noFormat"),
106
107 /**
108 * "The flag ignoreNonClassParameter for layout {0} was set to {1}. There is not a parameter named {2} for class {3}."
109 */
110 LAYOUT_IGNORE_PARAMETER_OFF("layout.ignoreParameterOff"),
111
112 /**
113 * "Mask don't match for field {0} with the value "{1}" \n\tFormat expected: {2} "{3}""
114 */
115 ITEM_MASK_DONT_MATCH("item.maskDontMatch"),
116
117 /**
118 * "There's no layout named {0} referenced on list {1}.{2}"
119 */
120 LIST_LAYOUTASSOCIATION_NOT_FOUND("list.layoutAssociationNotFound"),
121
122 /**
123 * "To retrieve a a layout the framework needs BaseNameSpaceTO.namePrefix and BaseNameSpaceTO.nameSufix properly filled. Provided: BaseNameSpaceTO.namePrefix - {0} and BaseNameSpaceTO.nameSufix - {1}"
124 */
125 LAYOUT_NOT_ENOUGH_INFORMATION("layout.notEnoughInformation"),
126
127 /**
128 * Layout {0} não foi achado.
129 */
130 LAYOUT_NOT_FOUND("layout.notFound"),
131
132 /**
133 * Could not find the mask named {0}.
134 */
135 MASK_NOT_FOUND("mask.notFound"),
136
137 /**
138 * There is already a layout named {0}. Please change the name of one of those layouts.
139 */
140 LAYOUT_DUPLICATE("layout.duplicate"),
141
142 /**
143 * Item {0} with no value and there is no <nullValue> tag informed on the layout.
144 */
145 ITEM_NO_NULL_VALUE("item.noNullValueTag"),
146
147 /**
148 * The value informed on tag <nullValue> of item {0} is bigger then the size of it informed on the layout.
149 */
150 ITEM_NULL_VALUE_TOO_BIG("item.nullValueTooBig"),
151
152 /**
153 * There is already a entry "{0}" for layout {1}.
154 */
155 ENTRY_DUPLICATE("entry.dubplicate"),
156
157 /**
158 * Could not find the listener named {0}.
159 */
160 LISTENER_NOT_FOUND("listener.notFound"),
161
162
163 /**
164 * Could not instantiate the listener named {0}.
165 */
166 LISTENER_INSTANTIATION("listener.instantiation"),
167
168 /**
169 * Could not instantiate the listener named {0} because it does not extend the class "net.sf.layoutParser.util.callback.LayoutListener".
170 */
171 LISTENER_CLASS_CAST("listener.wrongClass"),
172
173 /**
174 * Could not find a layout named {0} as a extension from {1}
175 */
176 LAYOUT_EXTENSION_NOT_FOUND("layout.extensionNotFound"),
177
178 /**
179 * Could not find the processor given by class {0} for layout {1}.
180 */
181 PROCESSOR_NOT_FOUND("layout.processorNotFound"),
182
183 /**
184 * Layout {0} defines more items to be read than actually exists.
185 */
186 LAYOUT_TOO_MANY_ITEMS("layout.tooManyItems"),
187
188 /**
189 * Could not parse defaults using xpath query: {0}.
190 */
191 PARSE_DEFAULTS("parse.defaults"),
192
193 /**
194 * Could not find the class {0} when defining defaults.
195 */
196 DEFAULT_CLASS_NOT_FOUND("default.classNotFound"),
197
198 /**
199 * Layout [{0}] is invalid to be used with processor [{1}]. See log errors for more information.
200 */
201 LAYOUT_INVALID_FOR_PROCESSOR("layout.invalid.for.processor"),
202
203 /**
204 * The property {2} could not be found for the type {1} in specified layout {0}
205 */
206 LAYOUT_ITEM_NOT_FOUND("layout.item.not.found");
207
208 private String key;
209
210 private ExceptionKey(String key){
211 this.key = key;
212 }
213
214 /**
215 * Return's the key name of the bundle.
216 *
217 * @see java.lang.Enum#toString()
218 */
219 @Override
220 public String toString() {
221 return key;
222 }
223
224
225 }