001 /*
002 // This java file was automatically generated
003 // from XOM model 'resource'
004 // on Thu Jun 28 23:30:03 UTC 2012
005 // Do not edit this file by hand.
006 */
007
008 package org.eigenbase.resgen;
009 /**
010 * This model specifies the elements which make up a resource file. See
011 * {@link ResourceGenTask} for more information.
012 * <p>This class was generated from XOM model 'resource' on Thu Jun 28 23:30:03 UTC 2012
013 */
014 public class ResourceDef {
015
016 public static java.lang.Class getXMLDefClass()
017 {
018 return ResourceDef.class;
019 }
020
021 public static String[] _elements = {
022 "resourceBundle",
023 "Code",
024 "resource",
025 "message",
026 "text",
027 "exception",
028 "property"
029 };
030
031 /**
032 * A ResourceBundle is a collection of resources.
033 * The resource generator generates a class from a resource bundle
034 * which has an accessor method for each resource.
035 */
036 public static class ResourceBundle extends org.eigenbase.xom.ElementDef
037 {
038 public ResourceBundle()
039 {
040 }
041
042 public ResourceBundle(org.eigenbase.xom.DOMWrapper _def)
043 throws org.eigenbase.xom.XOMException
044 {
045 try {
046 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", ResourceDef.class);
047 org.eigenbase.xom.NodeDef[] _tempArray;
048 locale = (String)_parser.getAttribute("locale", "String", null, null, true);
049 exceptionClassName = (String)_parser.getAttribute("exceptionClassName", "String", null, null, false);
050 cppNamespace = (String)_parser.getAttribute("cppNamespace", "String", null, null, false);
051 cppCommonInclude = (String)_parser.getAttribute("cppCommonInclude", "String", null, null, false);
052 cppExceptionClassName = (String)_parser.getAttribute("cppExceptionClassName", "String", null, null, false);
053 cppExceptionClassLocation = (String)_parser.getAttribute("cppExceptionClassLocation", "String", null, null, false);
054 _tempArray = _parser.getArray(Resource.class, 0, 0);
055 resources = new Resource[_tempArray.length];
056 for (int _i = 0; _i < resources.length; _i++)
057 resources[_i] = (Resource)_tempArray[_i];
058 code = (Code)_parser.getElement(Code.class, false);
059 } catch(org.eigenbase.xom.XOMException _ex) {
060 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
061 }
062 }
063
064 public String locale; // required attribute
065 public String exceptionClassName; // optional attribute
066 public String cppNamespace; // optional attribute
067 public String cppCommonInclude; // optional attribute
068 public String cppExceptionClassName; // optional attribute
069 public String cppExceptionClassLocation; // optional attribute
070
071 public Resource[] resources; //optional array
072 /**
073 * Text within this element is included in the generated class.
074 */
075 public Code code; //optional element
076
077 public String getName()
078 {
079 return "ResourceBundle";
080 }
081
082 public void display(java.io.PrintWriter _out, int _indent)
083 {
084 _out.println(getName());
085 displayAttribute(_out, "locale", locale, _indent+1);
086 displayAttribute(_out, "exceptionClassName", exceptionClassName, _indent+1);
087 displayAttribute(_out, "cppNamespace", cppNamespace, _indent+1);
088 displayAttribute(_out, "cppCommonInclude", cppCommonInclude, _indent+1);
089 displayAttribute(_out, "cppExceptionClassName", cppExceptionClassName, _indent+1);
090 displayAttribute(_out, "cppExceptionClassLocation", cppExceptionClassLocation, _indent+1);
091 displayElementArray(_out, "resources", resources, _indent+1);
092 displayElement(_out, "code", (org.eigenbase.xom.ElementDef) code, _indent+1);
093 }
094 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
095 {
096 _out.beginTag("resourceBundle", new org.eigenbase.xom.XMLAttrVector()
097 .add("locale", locale)
098 .add("exceptionClassName", exceptionClassName)
099 .add("cppNamespace", cppNamespace)
100 .add("cppCommonInclude", cppCommonInclude)
101 .add("cppExceptionClassName", cppExceptionClassName)
102 .add("cppExceptionClassLocation", cppExceptionClassLocation)
103 );
104 displayXMLElementArray(_out, resources);
105 displayXMLElement(_out, (org.eigenbase.xom.ElementDef) code);
106 _out.endTag("resourceBundle");
107 }
108 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
109 {
110 ResourceBundle _cother = (ResourceBundle)_other;
111 boolean _diff = displayAttributeDiff("locale", locale, _cother.locale, _out, _indent+1);
112 _diff = _diff && displayAttributeDiff("exceptionClassName", exceptionClassName, _cother.exceptionClassName, _out, _indent+1);
113 _diff = _diff && displayAttributeDiff("cppNamespace", cppNamespace, _cother.cppNamespace, _out, _indent+1);
114 _diff = _diff && displayAttributeDiff("cppCommonInclude", cppCommonInclude, _cother.cppCommonInclude, _out, _indent+1);
115 _diff = _diff && displayAttributeDiff("cppExceptionClassName", cppExceptionClassName, _cother.cppExceptionClassName, _out, _indent+1);
116 _diff = _diff && displayAttributeDiff("cppExceptionClassLocation", cppExceptionClassLocation, _cother.cppExceptionClassLocation, _out, _indent+1);
117 _diff = _diff && displayElementArrayDiff("resources", resources, _cother.resources, _out, _indent+1);
118 _diff = _diff && displayElementDiff("code", code, _cother.code, _out, _indent+1);
119 return _diff;
120 }
121 }
122
123 public static class Code extends org.eigenbase.xom.ElementDef
124 {
125 public Code()
126 {
127 }
128
129 public Code(org.eigenbase.xom.DOMWrapper _def)
130 throws org.eigenbase.xom.XOMException
131 {
132 try {
133 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", ResourceDef.class);
134 cdata = _parser.getText();
135 } catch(org.eigenbase.xom.XOMException _ex) {
136 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
137 }
138 }
139
140
141 public String cdata; // All text goes here
142 public String getName()
143 {
144 return "Code";
145 }
146
147 public void display(java.io.PrintWriter _out, int _indent)
148 {
149 _out.println(getName());
150 displayString(_out, "cdata", cdata, _indent+1);
151 }
152 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
153 {
154 _out.beginTag("Code", new org.eigenbase.xom.XMLAttrVector()
155 );
156 _out.cdata(cdata);
157 _out.endTag("Code");
158 }
159 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
160 {
161 Code _cother = (Code)_other;
162 boolean _diff = displayStringDiff("cdata", cdata, _cother.cdata, _out, _indent+1);
163 return _diff;
164 }
165 }
166
167 public static abstract class Resource extends org.eigenbase.xom.ElementDef
168 {
169 public Resource()
170 {
171 }
172
173 public Resource(org.eigenbase.xom.DOMWrapper _def)
174 throws org.eigenbase.xom.XOMException
175 {
176 this._def = _def;
177 try {
178 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", ResourceDef.class);
179 org.eigenbase.xom.NodeDef[] _tempArray;
180 name = (String)_parser.getAttribute("name", "String", null, null, true);
181 _tempArray = _parser.getArray(Property.class, 0, 0);
182 properties = new Property[_tempArray.length];
183 for (int _i = 0; _i < properties.length; _i++)
184 properties[_i] = (Property)_tempArray[_i];
185 text = (Text)_parser.getElement(Text.class, false);
186 } catch(org.eigenbase.xom.XOMException _ex) {
187 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
188 }
189 }
190
191 public String name; // required attribute
192 public org.eigenbase.xom.DOMWrapper _def;
193
194 public Property[] properties; //optional array
195 public Text text; //optional element
196
197 public String getName()
198 {
199 return "Resource";
200 }
201
202 public void display(java.io.PrintWriter _out, int _indent)
203 {
204 _out.println(getName());
205 displayAttribute(_out, "name", name, _indent+1);
206 displayElementArray(_out, "properties", properties, _indent+1);
207 displayElement(_out, "text", (org.eigenbase.xom.ElementDef) text, _indent+1);
208 }
209 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
210 {
211 _out.beginTag("resource", new org.eigenbase.xom.XMLAttrVector()
212 .add("name", name)
213 );
214 displayXMLElementArray(_out, properties);
215 displayXMLElement(_out, (org.eigenbase.xom.ElementDef) text);
216 _out.endTag("resource");
217 }
218 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
219 {
220 Resource _cother = (Resource)_other;
221 boolean _diff = displayAttributeDiff("name", name, _cother.name, _out, _indent+1);
222 _diff = _diff && displayElementArrayDiff("properties", properties, _cother.properties, _out, _indent+1);
223 _diff = _diff && displayElementDiff("text", text, _cother.text, _out, _indent+1);
224 return _diff;
225 }
226 // BEGIN pass-through code block ---
227 abstract org.eigenbase.xom.DOMWrapper getDef();
228 // END pass-through code block ---
229 }
230
231 /**
232 * A message.
233 */
234 public static class Message extends Resource
235 {
236 public Message()
237 {
238 }
239
240 public Message(org.eigenbase.xom.DOMWrapper _def)
241 throws org.eigenbase.xom.XOMException
242 {
243 this._def = _def;
244 try {
245 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", ResourceDef.class);
246 org.eigenbase.xom.NodeDef[] _tempArray;
247 name = (String)_parser.getAttribute("name", "String", null, null, true);
248 _tempArray = _parser.getArray(Property.class, 0, 0);
249 properties = new Property[_tempArray.length];
250 for (int _i = 0; _i < properties.length; _i++)
251 properties[_i] = (Property)_tempArray[_i];
252 text = (Text)_parser.getElement(Text.class, false);
253 } catch(org.eigenbase.xom.XOMException _ex) {
254 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
255 }
256 }
257
258 public org.eigenbase.xom.DOMWrapper _def;
259
260
261 public String getName()
262 {
263 return "Message";
264 }
265
266 public void display(java.io.PrintWriter _out, int _indent)
267 {
268 _out.println(getName());
269 displayAttribute(_out, "name", name, _indent+1);
270 displayElementArray(_out, "properties", properties, _indent+1);
271 displayElement(_out, "text", (org.eigenbase.xom.ElementDef) text, _indent+1);
272 }
273 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
274 {
275 _out.beginTag("message", new org.eigenbase.xom.XMLAttrVector()
276 .add("name", name)
277 );
278 displayXMLElementArray(_out, properties);
279 displayXMLElement(_out, (org.eigenbase.xom.ElementDef) text);
280 _out.endTag("message");
281 }
282 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
283 {
284 Message _cother = (Message)_other;
285 boolean _diff = displayElementArrayDiff("properties", properties, _cother.properties, _out, _indent+1);
286 _diff = _diff && displayElementDiff("text", text, _cother.text, _out, _indent+1);
287 return _diff;
288 }
289 // BEGIN pass-through code block ---
290 org.eigenbase.xom.DOMWrapper getDef() { return _def; }
291 // END pass-through code block ---
292 }
293
294 public static class Text extends org.eigenbase.xom.ElementDef
295 {
296 public Text()
297 {
298 }
299
300 public Text(org.eigenbase.xom.DOMWrapper _def)
301 throws org.eigenbase.xom.XOMException
302 {
303 try {
304 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", ResourceDef.class);
305 cdata = _parser.getText();
306 } catch(org.eigenbase.xom.XOMException _ex) {
307 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
308 }
309 }
310
311
312 public String cdata; // All text goes here
313 public String getName()
314 {
315 return "Text";
316 }
317
318 public void display(java.io.PrintWriter _out, int _indent)
319 {
320 _out.println(getName());
321 displayString(_out, "cdata", cdata, _indent+1);
322 }
323 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
324 {
325 _out.beginTag("text", new org.eigenbase.xom.XMLAttrVector()
326 );
327 _out.cdata(cdata);
328 _out.endTag("text");
329 }
330 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
331 {
332 Text _cother = (Text)_other;
333 boolean _diff = displayStringDiff("cdata", cdata, _cother.cdata, _out, _indent+1);
334 return _diff;
335 }
336 }
337
338 /**
339 * An exception defines a message which is issued in response
340 * to some invalid condition. It has a type, which must be derived from
341 * {@link Throwable}. The generated newExceptionName
342 * method creates an instance of this exception with the appropriate
343 * parameters.
344 */
345 public static class Exception extends Resource
346 {
347 public Exception()
348 {
349 }
350
351 public Exception(org.eigenbase.xom.DOMWrapper _def)
352 throws org.eigenbase.xom.XOMException
353 {
354 this._def = _def;
355 try {
356 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", ResourceDef.class);
357 org.eigenbase.xom.NodeDef[] _tempArray;
358 className = (String)_parser.getAttribute("className", "String", null, null, false);
359 cppClassName = (String)_parser.getAttribute("cppClassName", "String", null, null, false);
360 cppClassLocation = (String)_parser.getAttribute("cppClassLocation", "String", null, null, false);
361 cppChainExceptions = (String)_parser.getAttribute("cppChainExceptions", "String", null, null, false);
362 name = (String)_parser.getAttribute("name", "String", null, null, true);
363 _tempArray = _parser.getArray(Property.class, 0, 0);
364 properties = new Property[_tempArray.length];
365 for (int _i = 0; _i < properties.length; _i++)
366 properties[_i] = (Property)_tempArray[_i];
367 text = (Text)_parser.getElement(Text.class, false);
368 } catch(org.eigenbase.xom.XOMException _ex) {
369 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
370 }
371 }
372
373 public String className; // optional attribute
374 public String cppClassName; // optional attribute
375 public String cppClassLocation; // optional attribute
376 public String cppChainExceptions; // optional attribute
377 public org.eigenbase.xom.DOMWrapper _def;
378
379
380 public String getName()
381 {
382 return "Exception";
383 }
384
385 public void display(java.io.PrintWriter _out, int _indent)
386 {
387 _out.println(getName());
388 displayAttribute(_out, "className", className, _indent+1);
389 displayAttribute(_out, "cppClassName", cppClassName, _indent+1);
390 displayAttribute(_out, "cppClassLocation", cppClassLocation, _indent+1);
391 displayAttribute(_out, "cppChainExceptions", cppChainExceptions, _indent+1);
392 displayAttribute(_out, "name", name, _indent+1);
393 displayElementArray(_out, "properties", properties, _indent+1);
394 displayElement(_out, "text", (org.eigenbase.xom.ElementDef) text, _indent+1);
395 }
396 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
397 {
398 _out.beginTag("exception", new org.eigenbase.xom.XMLAttrVector()
399 .add("className", className)
400 .add("cppClassName", cppClassName)
401 .add("cppClassLocation", cppClassLocation)
402 .add("cppChainExceptions", cppChainExceptions)
403 .add("name", name)
404 );
405 displayXMLElementArray(_out, properties);
406 displayXMLElement(_out, (org.eigenbase.xom.ElementDef) text);
407 _out.endTag("exception");
408 }
409 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
410 {
411 Exception _cother = (Exception)_other;
412 boolean _diff = displayAttributeDiff("className", className, _cother.className, _out, _indent+1);
413 _diff = _diff && displayAttributeDiff("cppClassName", cppClassName, _cother.cppClassName, _out, _indent+1);
414 _diff = _diff && displayAttributeDiff("cppClassLocation", cppClassLocation, _cother.cppClassLocation, _out, _indent+1);
415 _diff = _diff && displayAttributeDiff("cppChainExceptions", cppChainExceptions, _cother.cppChainExceptions, _out, _indent+1);
416 _diff = _diff && displayElementArrayDiff("properties", properties, _cother.properties, _out, _indent+1);
417 _diff = _diff && displayElementDiff("text", text, _cother.text, _out, _indent+1);
418 return _diff;
419 }
420 // BEGIN pass-through code block ---
421 org.eigenbase.xom.DOMWrapper getDef() { return _def; }
422 // END pass-through code block ---
423 }
424
425 public static class Property extends org.eigenbase.xom.ElementDef
426 {
427 public Property()
428 {
429 }
430
431 public Property(org.eigenbase.xom.DOMWrapper _def)
432 throws org.eigenbase.xom.XOMException
433 {
434 try {
435 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", ResourceDef.class);
436 name = (String)_parser.getAttribute("name", "String", null, null, true);
437 cdata = _parser.getText();
438 } catch(org.eigenbase.xom.XOMException _ex) {
439 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
440 }
441 }
442
443 public String name; // required attribute
444
445 public String cdata; // All text goes here
446 public String getName()
447 {
448 return "Property";
449 }
450
451 public void display(java.io.PrintWriter _out, int _indent)
452 {
453 _out.println(getName());
454 displayAttribute(_out, "name", name, _indent+1);
455 displayString(_out, "cdata", cdata, _indent+1);
456 }
457 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
458 {
459 _out.beginTag("property", new org.eigenbase.xom.XMLAttrVector()
460 .add("name", name)
461 );
462 _out.cdata(cdata);
463 _out.endTag("property");
464 }
465 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
466 {
467 Property _cother = (Property)_other;
468 boolean _diff = displayAttributeDiff("name", name, _cother.name, _out, _indent+1);
469 _diff = _diff && displayStringDiff("cdata", cdata, _cother.cdata, _out, _indent+1);
470 return _diff;
471 }
472 }
473
474
475 }