001 /* 002 // This java file was automatically generated 003 // from XOM model 'meta' 004 // on Sat Nov 01 14:29:27 GMT-08:00 2008 005 // Do not edit this file by hand. 006 */ 007 008 package org.eigenbase.xom; 009 /** 010 * This model is the XOM Meta Model. It is the specification of the model used 011 * to define new XML-based models. It is also an instance of itself. 012 * <p>This class was generated from XOM model 'meta' on Sat Nov 01 14:29:27 GMT-08:00 2008 013 */ 014 public class MetaDef { 015 016 public static java.lang.Class getXMLDefClass() 017 { 018 return MetaDef.class; 019 } 020 021 public static String[] _elements = { 022 "Model", 023 "Definition", 024 "FullDefinition", 025 "Element", 026 "Class", 027 "StringElement", 028 "Plugin", 029 "Import", 030 "Doc", 031 "Code", 032 "Attribute", 033 "Value", 034 "Content", 035 "Object", 036 "Array", 037 "Any", 038 "CData" 039 }; 040 041 /** 042 * Model is the top-level element for a model description. The model element 043 * contains all other elements in the model and also defines the model's 044 * basic attributes, such as its name and version number. 045 */ 046 public static class Model extends org.eigenbase.xom.ElementDef 047 { 048 public Model() 049 { 050 } 051 052 public Model(org.eigenbase.xom.DOMWrapper _def) 053 throws org.eigenbase.xom.XOMException 054 { 055 this._def = _def; 056 try { 057 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", MetaDef.class); 058 org.eigenbase.xom.NodeDef[] _tempArray; 059 name = (String)_parser.getAttribute("name", "String", null, null, true); 060 dtdName = (String)_parser.getAttribute("dtdName", "String", null, null, false); 061 className = (String)_parser.getAttribute("className", "String", null, null, false); 062 packageName = (String)_parser.getAttribute("packageName", "String", null, null, false); 063 importName = (String)_parser.getAttribute("importName", "String", null, null, false); 064 root = (String)_parser.getAttribute("root", "String", null, null, true); 065 prefix = (String)_parser.getAttribute("prefix", "String", null, null, false); 066 version = (Double)_parser.getAttribute("version", "Double", null, null, true); 067 defaultKeepDef = (Boolean)_parser.getAttribute("defaultKeepDef", "Boolean", "false", null, false); 068 doc = _parser.getString(Doc, false); 069 _tempArray = _parser.getArray(Definition.class, 1, 0); 070 elements = new Definition[_tempArray.length]; 071 for (int _i = 0; _i < elements.length; _i++) 072 elements[_i] = (Definition)_tempArray[_i]; 073 } catch(org.eigenbase.xom.XOMException _ex) { 074 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); 075 } 076 } 077 078 public String name; // required attribute 079 public String dtdName; // optional attribute 080 public String className; // optional attribute 081 public String packageName; // optional attribute 082 public String importName; // optional attribute 083 public String root; // required attribute 084 public String prefix; // optional attribute 085 public Double version; // required attribute 086 public Boolean defaultKeepDef; // attribute default: false 087 public org.eigenbase.xom.DOMWrapper _def; 088 089 public String doc; //optional element 090 /** 091 * The elements array contains a definition for each element within the 092 * model. Elements include Class, Element, and String definitions. 093 */ 094 public Definition[] elements; //min 1 095 096 public String getName() 097 { 098 return "Model"; 099 } 100 101 public void display(java.io.PrintWriter _out, int _indent) 102 { 103 _out.println(getName()); 104 displayAttribute(_out, "name", name, _indent+1); 105 displayAttribute(_out, "dtdName", dtdName, _indent+1); 106 displayAttribute(_out, "className", className, _indent+1); 107 displayAttribute(_out, "packageName", packageName, _indent+1); 108 displayAttribute(_out, "importName", importName, _indent+1); 109 displayAttribute(_out, "root", root, _indent+1); 110 displayAttribute(_out, "prefix", prefix, _indent+1); 111 displayAttribute(_out, "version", version, _indent+1); 112 displayAttribute(_out, "defaultKeepDef", defaultKeepDef, _indent+1); 113 displayString(_out, "doc", doc, _indent+1); 114 displayElementArray(_out, "elements", elements, _indent+1); 115 } 116 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 117 { 118 _out.beginTag("Model", new org.eigenbase.xom.XMLAttrVector() 119 .add("name", name) 120 .add("dtdName", dtdName) 121 .add("className", className) 122 .add("packageName", packageName) 123 .add("importName", importName) 124 .add("root", root) 125 .add("prefix", prefix) 126 .add("version", version) 127 .add("defaultKeepDef", defaultKeepDef) 128 ); 129 displayXMLString(_out, "Doc", doc); 130 displayXMLElementArray(_out, elements); 131 _out.endTag("Model"); 132 } 133 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 134 { 135 Model _cother = (Model)_other; 136 boolean _diff = displayAttributeDiff("name", name, _cother.name, _out, _indent+1); 137 _diff = _diff && displayAttributeDiff("dtdName", dtdName, _cother.dtdName, _out, _indent+1); 138 _diff = _diff && displayAttributeDiff("className", className, _cother.className, _out, _indent+1); 139 _diff = _diff && displayAttributeDiff("packageName", packageName, _cother.packageName, _out, _indent+1); 140 _diff = _diff && displayAttributeDiff("importName", importName, _cother.importName, _out, _indent+1); 141 _diff = _diff && displayAttributeDiff("root", root, _cother.root, _out, _indent+1); 142 _diff = _diff && displayAttributeDiff("prefix", prefix, _cother.prefix, _out, _indent+1); 143 _diff = _diff && displayAttributeDiff("version", version, _cother.version, _out, _indent+1); 144 _diff = _diff && displayAttributeDiff("defaultKeepDef", defaultKeepDef, _cother.defaultKeepDef, _out, _indent+1); 145 _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); 146 _diff = _diff && displayElementArrayDiff("elements", elements, _cother.elements, _out, _indent+1); 147 return _diff; 148 } 149 } 150 151 /** 152 * The Definition class represents a generic type of element definition. 153 * The actual definition may be of a Class, Element, or String. 154 * Definitions are the basic building blocks of a model. 155 */ 156 public static abstract class Definition extends org.eigenbase.xom.ElementDef 157 { 158 public Definition() 159 { 160 } 161 162 public Definition(org.eigenbase.xom.DOMWrapper _def) 163 throws org.eigenbase.xom.XOMException 164 { 165 try { 166 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", MetaDef.class); 167 doc = _parser.getString(Doc, false); 168 } catch(org.eigenbase.xom.XOMException _ex) { 169 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); 170 } 171 } 172 173 174 /** 175 * Doc tags allow documentation to be added to any definition. The 176 * documentation will automatically appear in all physical forms 177 * of this model, including dtds, java classes, and the xsl 178 * transformation. 179 */ 180 public String doc; //optional element 181 182 public String getName() 183 { 184 return "Definition"; 185 } 186 187 public void display(java.io.PrintWriter _out, int _indent) 188 { 189 _out.println(getName()); 190 displayString(_out, "doc", doc, _indent+1); 191 } 192 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 193 { 194 _out.beginTag("(%Definition;)", new org.eigenbase.xom.XMLAttrVector() 195 ); 196 displayXMLString(_out, "Doc", doc); 197 _out.endTag("(%Definition;)"); 198 } 199 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 200 { 201 Definition _cother = (Definition)_other; 202 boolean _diff = displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); 203 return _diff; 204 } 205 } 206 207 /** 208 * The FullDefinition class represents a fully-specified definition 209 * that may include content. 210 */ 211 public static abstract class FullDefinition extends Definition 212 { 213 public FullDefinition() 214 { 215 } 216 217 public FullDefinition(org.eigenbase.xom.DOMWrapper _def) 218 throws org.eigenbase.xom.XOMException 219 { 220 try { 221 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", MetaDef.class); 222 org.eigenbase.xom.NodeDef[] _tempArray; 223 contentModel = (String)_parser.getAttribute("contentModel", "String", "sequential", _contentModel_values, false); 224 keepDef = (Boolean)_parser.getAttribute("keepDef", "Boolean", null, null, false); 225 doc = _parser.getString(Doc, false); 226 _tempArray = _parser.getArray(Attribute.class, 0, 0); 227 attributes = new Attribute[_tempArray.length]; 228 for (int _i = 0; _i < attributes.length; _i++) 229 attributes[_i] = (Attribute)_tempArray[_i]; 230 _tempArray = _parser.getArray(Content.class, 0, 0); 231 content = new Content[_tempArray.length]; 232 for (int _i = 0; _i < content.length; _i++) 233 content[_i] = (Content)_tempArray[_i]; 234 any = (Any)_parser.getElement(Any.class, false); 235 cdata = (CData)_parser.getElement(CData.class, false); 236 code = _parser.getString(Code, false); 237 } catch(org.eigenbase.xom.XOMException _ex) { 238 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); 239 } 240 } 241 242 /** Allowable values for {@link #contentModel}. */ 243 public static final String[] _contentModel_values = {"sequential", "random", "mixed", "any", "cdata"}; 244 public String contentModel; // attribute default: sequential 245 public Boolean keepDef; // optional attribute 246 247 /** 248 * This array defines all attributes to appear within this class or 249 * element. 250 */ 251 public Attribute[] attributes; //optional array 252 /** 253 * This array defines all content (objects and arrays) to appear within 254 * this class or element. The interpretation of this array depends 255 * on the element's defined content model. 256 */ 257 public Content[] content; //optional array 258 public Any any; //optional element 259 public CData cdata; //optional element 260 /** 261 * This element allows arbitrary Java Code to be attached to any 262 * class or element. Code sections are not verified until the final 263 * .java class is compiled and should be used sparingly. 264 */ 265 public String code; //optional element 266 267 public String getName() 268 { 269 return "FullDefinition"; 270 } 271 272 public void display(java.io.PrintWriter _out, int _indent) 273 { 274 _out.println(getName()); 275 displayAttribute(_out, "contentModel", contentModel, _indent+1); 276 displayAttribute(_out, "keepDef", keepDef, _indent+1); 277 displayString(_out, "doc", doc, _indent+1); 278 displayElementArray(_out, "attributes", attributes, _indent+1); 279 displayElementArray(_out, "content", content, _indent+1); 280 displayElement(_out, "any", any, _indent+1); 281 displayElement(_out, "cdata", cdata, _indent+1); 282 displayString(_out, "code", code, _indent+1); 283 } 284 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 285 { 286 _out.beginTag("(%FullDefinition;)", new org.eigenbase.xom.XMLAttrVector() 287 .add("contentModel", contentModel) 288 .add("keepDef", keepDef) 289 ); 290 displayXMLString(_out, "Doc", doc); 291 displayXMLElementArray(_out, attributes); 292 displayXMLElementArray(_out, content); 293 displayXMLElement(_out, any); 294 displayXMLElement(_out, cdata); 295 displayXMLString(_out, "Code", code); 296 _out.endTag("(%FullDefinition;)"); 297 } 298 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 299 { 300 FullDefinition _cother = (FullDefinition)_other; 301 boolean _diff = displayAttributeDiff("contentModel", contentModel, _cother.contentModel, _out, _indent+1); 302 _diff = _diff && displayAttributeDiff("keepDef", keepDef, _cother.keepDef, _out, _indent+1); 303 _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); 304 _diff = _diff && displayElementArrayDiff("attributes", attributes, _cother.attributes, _out, _indent+1); 305 _diff = _diff && displayElementArrayDiff("content", content, _cother.content, _out, _indent+1); 306 _diff = _diff && displayElementDiff("any", any, _cother.any, _out, _indent+1); 307 _diff = _diff && displayElementDiff("cdata", cdata, _cother.cdata, _out, _indent+1); 308 _diff = _diff && displayStringDiff("code", code, _cother.code, _out, _indent+1); 309 return _diff; 310 } 311 } 312 313 /** 314 * An Element Definition defines a basic entity of the meta model. Elements 315 * are containers for two types of data: attributes and content. Attributes 316 * are simple name/value pairs which may take on the full range of Java 317 * types. Content consists of other Elements and Strings, either 318 * appearing alone or as arrays. 319 */ 320 public static class Element extends FullDefinition 321 { 322 public Element() 323 { 324 } 325 326 public Element(org.eigenbase.xom.DOMWrapper _def) 327 throws org.eigenbase.xom.XOMException 328 { 329 this._def = _def; 330 try { 331 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", MetaDef.class); 332 org.eigenbase.xom.NodeDef[] _tempArray; 333 type = (String)_parser.getAttribute("type", "String", null, null, true); 334 _class = (String)_parser.getAttribute("class", "String", null, null, false); 335 dtdName = (String)_parser.getAttribute("dtdName", "String", null, null, false); 336 contentModel = (String)_parser.getAttribute("contentModel", "String", "sequential", _contentModel_values, false); 337 keepDef = (Boolean)_parser.getAttribute("keepDef", "Boolean", null, null, false); 338 doc = _parser.getString(Doc, false); 339 _tempArray = _parser.getArray(Attribute.class, 0, 0); 340 attributes = new Attribute[_tempArray.length]; 341 for (int _i = 0; _i < attributes.length; _i++) 342 attributes[_i] = (Attribute)_tempArray[_i]; 343 _tempArray = _parser.getArray(Content.class, 0, 0); 344 content = new Content[_tempArray.length]; 345 for (int _i = 0; _i < content.length; _i++) 346 content[_i] = (Content)_tempArray[_i]; 347 any = (Any)_parser.getElement(Any.class, false); 348 cdata = (CData)_parser.getElement(CData.class, false); 349 code = _parser.getString(Code, false); 350 } catch(org.eigenbase.xom.XOMException _ex) { 351 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); 352 } 353 } 354 355 public String type; // required attribute 356 public String _class; // optional attribute 357 public String dtdName; // optional attribute 358 public org.eigenbase.xom.DOMWrapper _def; 359 360 361 public String getName() 362 { 363 return "Element"; 364 } 365 366 public void display(java.io.PrintWriter _out, int _indent) 367 { 368 _out.println(getName()); 369 displayAttribute(_out, "type", type, _indent+1); 370 displayAttribute(_out, "class", _class, _indent+1); 371 displayAttribute(_out, "dtdName", dtdName, _indent+1); 372 displayAttribute(_out, "contentModel", contentModel, _indent+1); 373 displayAttribute(_out, "keepDef", keepDef, _indent+1); 374 displayString(_out, "doc", doc, _indent+1); 375 displayElementArray(_out, "attributes", attributes, _indent+1); 376 displayElementArray(_out, "content", content, _indent+1); 377 displayElement(_out, "any", any, _indent+1); 378 displayElement(_out, "cdata", cdata, _indent+1); 379 displayString(_out, "code", code, _indent+1); 380 } 381 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 382 { 383 _out.beginTag("Element", new org.eigenbase.xom.XMLAttrVector() 384 .add("type", type) 385 .add("class", _class) 386 .add("dtdName", dtdName) 387 .add("contentModel", contentModel) 388 .add("keepDef", keepDef) 389 ); 390 displayXMLString(_out, "Doc", doc); 391 displayXMLElementArray(_out, attributes); 392 displayXMLElementArray(_out, content); 393 displayXMLElement(_out, any); 394 displayXMLElement(_out, cdata); 395 displayXMLString(_out, "Code", code); 396 _out.endTag("Element"); 397 } 398 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 399 { 400 Element _cother = (Element)_other; 401 boolean _diff = displayAttributeDiff("type", type, _cother.type, _out, _indent+1); 402 _diff = _diff && displayAttributeDiff("class", _class, _cother._class, _out, _indent+1); 403 _diff = _diff && displayAttributeDiff("dtdName", dtdName, _cother.dtdName, _out, _indent+1); 404 _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); 405 _diff = _diff && displayElementArrayDiff("attributes", attributes, _cother.attributes, _out, _indent+1); 406 _diff = _diff && displayElementArrayDiff("content", content, _cother.content, _out, _indent+1); 407 _diff = _diff && displayElementDiff("any", any, _cother.any, _out, _indent+1); 408 _diff = _diff && displayElementDiff("cdata", cdata, _cother.cdata, _out, _indent+1); 409 _diff = _diff && displayStringDiff("code", code, _cother.code, _out, _indent+1); 410 return _diff; 411 } 412 } 413 414 /** 415 * A Class Definition defines a class of entities. A class specifies a group 416 * of entities with similar properties. Full inheritence is supported, 417 * although there are limits on what can be overridden. 418 */ 419 public static class Class extends FullDefinition 420 { 421 public Class() 422 { 423 } 424 425 public Class(org.eigenbase.xom.DOMWrapper _def) 426 throws org.eigenbase.xom.XOMException 427 { 428 this._def = _def; 429 try { 430 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", MetaDef.class); 431 org.eigenbase.xom.NodeDef[] _tempArray; 432 _class = (String)_parser.getAttribute("class", "String", null, null, true); 433 superclass = (String)_parser.getAttribute("superclass", "String", null, null, false); 434 contentModel = (String)_parser.getAttribute("contentModel", "String", "sequential", _contentModel_values, false); 435 keepDef = (Boolean)_parser.getAttribute("keepDef", "Boolean", null, null, false); 436 doc = _parser.getString(Doc, false); 437 _tempArray = _parser.getArray(Attribute.class, 0, 0); 438 attributes = new Attribute[_tempArray.length]; 439 for (int _i = 0; _i < attributes.length; _i++) 440 attributes[_i] = (Attribute)_tempArray[_i]; 441 _tempArray = _parser.getArray(Content.class, 0, 0); 442 content = new Content[_tempArray.length]; 443 for (int _i = 0; _i < content.length; _i++) 444 content[_i] = (Content)_tempArray[_i]; 445 any = (Any)_parser.getElement(Any.class, false); 446 cdata = (CData)_parser.getElement(CData.class, false); 447 code = _parser.getString(Code, false); 448 } catch(org.eigenbase.xom.XOMException _ex) { 449 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); 450 } 451 } 452 453 public String _class; // required attribute 454 public String superclass; // optional attribute 455 public org.eigenbase.xom.DOMWrapper _def; 456 457 458 public String getName() 459 { 460 return "Class"; 461 } 462 463 public void display(java.io.PrintWriter _out, int _indent) 464 { 465 _out.println(getName()); 466 displayAttribute(_out, "class", _class, _indent+1); 467 displayAttribute(_out, "superclass", superclass, _indent+1); 468 displayAttribute(_out, "contentModel", contentModel, _indent+1); 469 displayAttribute(_out, "keepDef", keepDef, _indent+1); 470 displayString(_out, "doc", doc, _indent+1); 471 displayElementArray(_out, "attributes", attributes, _indent+1); 472 displayElementArray(_out, "content", content, _indent+1); 473 displayElement(_out, "any", any, _indent+1); 474 displayElement(_out, "cdata", cdata, _indent+1); 475 displayString(_out, "code", code, _indent+1); 476 } 477 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 478 { 479 _out.beginTag("Class", new org.eigenbase.xom.XMLAttrVector() 480 .add("class", _class) 481 .add("superclass", superclass) 482 .add("contentModel", contentModel) 483 .add("keepDef", keepDef) 484 ); 485 displayXMLString(_out, "Doc", doc); 486 displayXMLElementArray(_out, attributes); 487 displayXMLElementArray(_out, content); 488 displayXMLElement(_out, any); 489 displayXMLElement(_out, cdata); 490 displayXMLString(_out, "Code", code); 491 _out.endTag("Class"); 492 } 493 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 494 { 495 Class _cother = (Class)_other; 496 boolean _diff = displayAttributeDiff("class", _class, _cother._class, _out, _indent+1); 497 _diff = _diff && displayAttributeDiff("superclass", superclass, _cother.superclass, _out, _indent+1); 498 _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); 499 _diff = _diff && displayElementArrayDiff("attributes", attributes, _cother.attributes, _out, _indent+1); 500 _diff = _diff && displayElementArrayDiff("content", content, _cother.content, _out, _indent+1); 501 _diff = _diff && displayElementDiff("any", any, _cother.any, _out, _indent+1); 502 _diff = _diff && displayElementDiff("cdata", cdata, _cother.cdata, _out, _indent+1); 503 _diff = _diff && displayStringDiff("code", code, _cother.code, _out, _indent+1); 504 return _diff; 505 } 506 } 507 508 /** 509 * A StringElement is a simple type of element which has no attributes and 510 * whose content is a single String (usually represented as a CDATA section). 511 * StringElements are used when raw text must be included in a model, such 512 * as raw Java code, or SQL statements, or HTML documentation. 513 */ 514 public static class StringElement extends Definition 515 { 516 public StringElement() 517 { 518 } 519 520 public StringElement(org.eigenbase.xom.DOMWrapper _def) 521 throws org.eigenbase.xom.XOMException 522 { 523 this._def = _def; 524 try { 525 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", MetaDef.class); 526 type = (String)_parser.getAttribute("type", "String", null, null, true); 527 doc = _parser.getString(Doc, false); 528 } catch(org.eigenbase.xom.XOMException _ex) { 529 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); 530 } 531 } 532 533 public String type; // required attribute 534 public org.eigenbase.xom.DOMWrapper _def; 535 536 537 public String getName() 538 { 539 return "StringElement"; 540 } 541 542 public void display(java.io.PrintWriter _out, int _indent) 543 { 544 _out.println(getName()); 545 displayAttribute(_out, "type", type, _indent+1); 546 displayString(_out, "doc", doc, _indent+1); 547 } 548 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 549 { 550 _out.beginTag("StringElement", new org.eigenbase.xom.XMLAttrVector() 551 .add("type", type) 552 ); 553 displayXMLString(_out, "Doc", doc); 554 _out.endTag("StringElement"); 555 } 556 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 557 { 558 StringElement _cother = (StringElement)_other; 559 boolean _diff = displayAttributeDiff("type", type, _cother.type, _out, _indent+1); 560 _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); 561 return _diff; 562 } 563 } 564 565 /** 566 * A Plugin in a special type of element whose content may be derived from 567 * a different model. The exact model to use is specified by the 568 * individual XML file, allowing a Plugin element to link to another 569 * model dynamically. The Plugin element automatically defines the 570 * defPackage and defClass attributes. Other attributes may be added 571 * as needed. Code and documentation sections are supported as well. 572 */ 573 public static class Plugin extends Definition 574 { 575 public Plugin() 576 { 577 } 578 579 public Plugin(org.eigenbase.xom.DOMWrapper _def) 580 throws org.eigenbase.xom.XOMException 581 { 582 this._def = _def; 583 try { 584 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", MetaDef.class); 585 org.eigenbase.xom.NodeDef[] _tempArray; 586 type = (String)_parser.getAttribute("type", "String", null, null, true); 587 _class = (String)_parser.getAttribute("class", "String", null, null, false); 588 doc = _parser.getString(Doc, false); 589 _tempArray = _parser.getArray(Attribute.class, 0, 0); 590 attributes = new Attribute[_tempArray.length]; 591 for (int _i = 0; _i < attributes.length; _i++) 592 attributes[_i] = (Attribute)_tempArray[_i]; 593 code = _parser.getString(Code, false); 594 } catch(org.eigenbase.xom.XOMException _ex) { 595 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); 596 } 597 } 598 599 public String type; // required attribute 600 public String _class; // optional attribute 601 public org.eigenbase.xom.DOMWrapper _def; 602 603 public Attribute[] attributes; //optional array 604 public String code; //optional element 605 606 public String getName() 607 { 608 return "Plugin"; 609 } 610 611 public void display(java.io.PrintWriter _out, int _indent) 612 { 613 _out.println(getName()); 614 displayAttribute(_out, "type", type, _indent+1); 615 displayAttribute(_out, "class", _class, _indent+1); 616 displayString(_out, "doc", doc, _indent+1); 617 displayElementArray(_out, "attributes", attributes, _indent+1); 618 displayString(_out, "code", code, _indent+1); 619 } 620 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 621 { 622 _out.beginTag("Plugin", new org.eigenbase.xom.XMLAttrVector() 623 .add("type", type) 624 .add("class", _class) 625 ); 626 displayXMLString(_out, "Doc", doc); 627 displayXMLElementArray(_out, attributes); 628 displayXMLString(_out, "Code", code); 629 _out.endTag("Plugin"); 630 } 631 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 632 { 633 Plugin _cother = (Plugin)_other; 634 boolean _diff = displayAttributeDiff("type", type, _cother.type, _out, _indent+1); 635 _diff = _diff && displayAttributeDiff("class", _class, _cother._class, _out, _indent+1); 636 _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); 637 _diff = _diff && displayElementArrayDiff("attributes", attributes, _cother.attributes, _out, _indent+1); 638 _diff = _diff && displayStringDiff("code", code, _cother.code, _out, _indent+1); 639 return _diff; 640 } 641 } 642 643 /** 644 * An Import as a special type of element that represents another element 645 * stored in an external model. The model to use is specified by the 646 * defPackage and defClass attributes of the import. 647 * An Import may not be derived from any class. 648 */ 649 public static class Import extends Definition 650 { 651 public Import() 652 { 653 } 654 655 public Import(org.eigenbase.xom.DOMWrapper _def) 656 throws org.eigenbase.xom.XOMException 657 { 658 this._def = _def; 659 try { 660 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", MetaDef.class); 661 type = (String)_parser.getAttribute("type", "String", null, null, true); 662 defPackage = (String)_parser.getAttribute("defPackage", "String", null, null, true); 663 defClass = (String)_parser.getAttribute("defClass", "String", null, null, true); 664 dtdName = (String)_parser.getAttribute("dtdName", "String", null, null, false); 665 doc = _parser.getString(Doc, false); 666 } catch(org.eigenbase.xom.XOMException _ex) { 667 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); 668 } 669 } 670 671 public String type; // required attribute 672 public String defPackage; // required attribute 673 public String defClass; // required attribute 674 public String dtdName; // optional attribute 675 public org.eigenbase.xom.DOMWrapper _def; 676 677 678 public String getName() 679 { 680 return "Import"; 681 } 682 683 public void display(java.io.PrintWriter _out, int _indent) 684 { 685 _out.println(getName()); 686 displayAttribute(_out, "type", type, _indent+1); 687 displayAttribute(_out, "defPackage", defPackage, _indent+1); 688 displayAttribute(_out, "defClass", defClass, _indent+1); 689 displayAttribute(_out, "dtdName", dtdName, _indent+1); 690 displayString(_out, "doc", doc, _indent+1); 691 } 692 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 693 { 694 _out.beginTag("Import", new org.eigenbase.xom.XMLAttrVector() 695 .add("type", type) 696 .add("defPackage", defPackage) 697 .add("defClass", defClass) 698 .add("dtdName", dtdName) 699 ); 700 displayXMLString(_out, "Doc", doc); 701 _out.endTag("Import"); 702 } 703 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 704 { 705 Import _cother = (Import)_other; 706 boolean _diff = displayAttributeDiff("type", type, _cother.type, _out, _indent+1); 707 _diff = _diff && displayAttributeDiff("defPackage", defPackage, _cother.defPackage, _out, _indent+1); 708 _diff = _diff && displayAttributeDiff("defClass", defClass, _cother.defClass, _out, _indent+1); 709 _diff = _diff && displayAttributeDiff("dtdName", dtdName, _cother.dtdName, _out, _indent+1); 710 _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); 711 return _diff; 712 } 713 } 714 715 /** 716 * The Doc entity specifies a documentation section. The text contained 717 * in this element should be raw text or HTML used to document the object 718 * in which the Doc section appears. 719 */ 720 public static final String Doc = "Doc"; 721 722 /** 723 * The Code entity specifies a raw block of Java code. Each Class/Element 724 * becomes represented by a Java Class. Including a Code block inside 725 * a Class or Element will insert the code directly into the corresponding 726 * class. No checking is done on the code until it is complied later. 727 */ 728 public static final String Code = "Code"; 729 730 /** 731 * The Attribute entity appears within any Element definition. It defines 732 * an Attribute, which is a name/value pair used to hold data inside of an 733 * Element. The Attribute's definition includes its name, type, and 734 * usage information (default value and whether or not it is required). 735 * An Attribute definition may limit its values by specifying Value 736 * objects. 737 */ 738 public static class Attribute extends org.eigenbase.xom.ElementDef 739 { 740 public Attribute() 741 { 742 } 743 744 public Attribute(org.eigenbase.xom.DOMWrapper _def) 745 throws org.eigenbase.xom.XOMException 746 { 747 this._def = _def; 748 try { 749 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", MetaDef.class); 750 org.eigenbase.xom.NodeDef[] _tempArray; 751 name = (String)_parser.getAttribute("name", "String", null, null, true); 752 type = (String)_parser.getAttribute("type", "String", "String", null, false); 753 required = (Boolean)_parser.getAttribute("required", "Boolean", "false", null, false); 754 _default = (String)_parser.getAttribute("default", "String", null, null, false); 755 doc = _parser.getString(Doc, false); 756 values = _parser.getStringArray("Value", 0, 0); 757 } catch(org.eigenbase.xom.XOMException _ex) { 758 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); 759 } 760 } 761 762 public String name; // required attribute 763 public String type; // attribute default: String 764 public Boolean required; // attribute default: false 765 public String _default; // optional attribute 766 public org.eigenbase.xom.DOMWrapper _def; 767 768 public String doc; //optional element 769 public String[] values; //optional array 770 771 public String getName() 772 { 773 return "Attribute"; 774 } 775 776 public void display(java.io.PrintWriter _out, int _indent) 777 { 778 _out.println(getName()); 779 displayAttribute(_out, "name", name, _indent+1); 780 displayAttribute(_out, "type", type, _indent+1); 781 displayAttribute(_out, "required", required, _indent+1); 782 displayAttribute(_out, "default", _default, _indent+1); 783 displayString(_out, "doc", doc, _indent+1); 784 displayStringArray(_out, "values", values, _indent+1); 785 } 786 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 787 { 788 _out.beginTag("Attribute", new org.eigenbase.xom.XMLAttrVector() 789 .add("name", name) 790 .add("type", type) 791 .add("required", required) 792 .add("default", _default) 793 ); 794 displayXMLString(_out, "Doc", doc); 795 displayXMLStringArray(_out, "Value", values); 796 _out.endTag("Attribute"); 797 } 798 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 799 { 800 Attribute _cother = (Attribute)_other; 801 boolean _diff = displayAttributeDiff("name", name, _cother.name, _out, _indent+1); 802 _diff = _diff && displayAttributeDiff("type", type, _cother.type, _out, _indent+1); 803 _diff = _diff && displayAttributeDiff("required", required, _cother.required, _out, _indent+1); 804 _diff = _diff && displayAttributeDiff("default", _default, _cother._default, _out, _indent+1); 805 _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); 806 _diff = _diff && displayStringArrayDiff("values", values, _cother.values, _out, _indent+1); 807 return _diff; 808 } 809 } 810 811 /** 812 * The Value entity specifies a single value in the set of allowed values 813 * for an Attribute. The value is specifies as text so that any special 814 * characters may appear. 815 */ 816 public static final String Value = "Value"; 817 818 /** 819 * The Content class contains all entities which represent types of 820 * content which may appear within an Element. Content includes 821 * Objects, Arrays, Strings, and special markers such as Any. 822 */ 823 public static abstract class Content extends org.eigenbase.xom.ElementDef 824 { 825 public Content() 826 { 827 } 828 829 public Content(org.eigenbase.xom.DOMWrapper _def) 830 throws org.eigenbase.xom.XOMException 831 { 832 } 833 834 835 836 public String getName() 837 { 838 return "Content"; 839 } 840 841 public void display(java.io.PrintWriter _out, int _indent) 842 { 843 } 844 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 845 { 846 _out.beginTag("(%Content;)", new org.eigenbase.xom.XMLAttrVector() 847 ); 848 _out.endTag("(%Content;)"); 849 } 850 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 851 { 852 return true; 853 } 854 } 855 856 /** 857 * An Object is a single instance of an Element type. Objects have an 858 * identifying name and a type. The name identifies the object within 859 * its Element and must be unique within the Element. The object is itself 860 * an instance of an Element, and this Element is identified by the type. 861 * The type may be the type name of an Element or the class name of a Class. 862 */ 863 public static class Object extends Content 864 { 865 public Object() 866 { 867 } 868 869 public Object(org.eigenbase.xom.DOMWrapper _def) 870 throws org.eigenbase.xom.XOMException 871 { 872 this._def = _def; 873 try { 874 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", MetaDef.class); 875 name = (String)_parser.getAttribute("name", "String", null, null, true); 876 type = (String)_parser.getAttribute("type", "String", null, null, true); 877 required = (Boolean)_parser.getAttribute("required", "Boolean", "false", null, false); 878 doc = _parser.getString(Doc, false); 879 } catch(org.eigenbase.xom.XOMException _ex) { 880 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); 881 } 882 } 883 884 public String name; // required attribute 885 public String type; // required attribute 886 public Boolean required; // attribute default: false 887 public org.eigenbase.xom.DOMWrapper _def; 888 889 public String doc; //optional element 890 891 public String getName() 892 { 893 return "Object"; 894 } 895 896 public void display(java.io.PrintWriter _out, int _indent) 897 { 898 _out.println(getName()); 899 displayAttribute(_out, "name", name, _indent+1); 900 displayAttribute(_out, "type", type, _indent+1); 901 displayAttribute(_out, "required", required, _indent+1); 902 displayString(_out, "doc", doc, _indent+1); 903 } 904 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 905 { 906 _out.beginTag("Object", new org.eigenbase.xom.XMLAttrVector() 907 .add("name", name) 908 .add("type", type) 909 .add("required", required) 910 ); 911 displayXMLString(_out, "Doc", doc); 912 _out.endTag("Object"); 913 } 914 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 915 { 916 Object _cother = (Object)_other; 917 boolean _diff = displayAttributeDiff("name", name, _cother.name, _out, _indent+1); 918 _diff = _diff && displayAttributeDiff("type", type, _cother.type, _out, _indent+1); 919 _diff = _diff && displayAttributeDiff("required", required, _cother.required, _out, _indent+1); 920 _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); 921 return _diff; 922 } 923 } 924 925 /** 926 * An Array is a set of multiple instances of Elements. The Array 927 * has an identifying name and a base type. The name identifies the array 928 * within its Element and must be unique within the Element. Each object 929 * in the array is an instance of the Element identified by the type. 930 * The type may be the type name of an Element or the class name of a Class. 931 */ 932 public static class Array extends Content 933 { 934 public Array() 935 { 936 } 937 938 public Array(org.eigenbase.xom.DOMWrapper _def) 939 throws org.eigenbase.xom.XOMException 940 { 941 this._def = _def; 942 try { 943 org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", MetaDef.class); 944 name = (String)_parser.getAttribute("name", "String", null, null, true); 945 type = (String)_parser.getAttribute("type", "String", null, null, true); 946 min = (Integer)_parser.getAttribute("min", "Integer", "0", null, false); 947 max = (Integer)_parser.getAttribute("max", "Integer", "0", null, false); 948 doc = _parser.getString(Doc, false); 949 } catch(org.eigenbase.xom.XOMException _ex) { 950 throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); 951 } 952 } 953 954 public String name; // required attribute 955 public String type; // required attribute 956 public Integer min; // attribute default: 0 957 public Integer max; // attribute default: 0 958 public org.eigenbase.xom.DOMWrapper _def; 959 960 public String doc; //optional element 961 962 public String getName() 963 { 964 return "Array"; 965 } 966 967 public void display(java.io.PrintWriter _out, int _indent) 968 { 969 _out.println(getName()); 970 displayAttribute(_out, "name", name, _indent+1); 971 displayAttribute(_out, "type", type, _indent+1); 972 displayAttribute(_out, "min", min, _indent+1); 973 displayAttribute(_out, "max", max, _indent+1); 974 displayString(_out, "doc", doc, _indent+1); 975 } 976 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 977 { 978 _out.beginTag("Array", new org.eigenbase.xom.XMLAttrVector() 979 .add("name", name) 980 .add("type", type) 981 .add("min", min) 982 .add("max", max) 983 ); 984 displayXMLString(_out, "Doc", doc); 985 _out.endTag("Array"); 986 } 987 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 988 { 989 Array _cother = (Array)_other; 990 boolean _diff = displayAttributeDiff("name", name, _cother.name, _out, _indent+1); 991 _diff = _diff && displayAttributeDiff("type", type, _cother.type, _out, _indent+1); 992 _diff = _diff && displayAttributeDiff("min", min, _cother.min, _out, _indent+1); 993 _diff = _diff && displayAttributeDiff("max", max, _cother.max, _out, _indent+1); 994 _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); 995 return _diff; 996 } 997 } 998 999 /** 1000 * The Any content is a special marker which allows an Element to 1001 * contain any type of data. The data will appear in a single 1002 * array called "children". The data will contain all kinds of 1003 * node (elements, comments, text) if the content model is 1004 * "mixed", otherwise just elements. If an Any marker appears, no other 1005 * content may appear in the element. 1006 */ 1007 public static class Any extends Content 1008 { 1009 public Any() 1010 { 1011 } 1012 1013 public Any(org.eigenbase.xom.DOMWrapper _def) 1014 throws org.eigenbase.xom.XOMException 1015 { 1016 } 1017 1018 public org.eigenbase.xom.DOMWrapper _def; 1019 1020 1021 public String getName() 1022 { 1023 return "Any"; 1024 } 1025 1026 public void display(java.io.PrintWriter _out, int _indent) 1027 { 1028 _out.println(getName()); 1029 } 1030 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 1031 { 1032 _out.beginTag("Any", new org.eigenbase.xom.XMLAttrVector() 1033 ); 1034 _out.endTag("Any"); 1035 } 1036 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 1037 { 1038 return true; 1039 } 1040 } 1041 1042 /** 1043 * The CData content is a special marker which allows an Element to 1044 * contain a single CDATA section as its only content, yet still 1045 * have attributes. The data will appear in a single String 1046 * called "cdata". If a CData marker appears, no other 1047 * content may appear in the element. 1048 */ 1049 public static class CData extends Content 1050 { 1051 public CData() 1052 { 1053 } 1054 1055 public CData(org.eigenbase.xom.DOMWrapper _def) 1056 throws org.eigenbase.xom.XOMException 1057 { 1058 } 1059 1060 public org.eigenbase.xom.DOMWrapper _def; 1061 1062 1063 public String getName() 1064 { 1065 return "CData"; 1066 } 1067 1068 public void display(java.io.PrintWriter _out, int _indent) 1069 { 1070 _out.println(getName()); 1071 } 1072 public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent) 1073 { 1074 _out.beginTag("CData", new org.eigenbase.xom.XMLAttrVector() 1075 ); 1076 _out.endTag("CData"); 1077 } 1078 public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) 1079 { 1080 return true; 1081 } 1082 } 1083 1084 1085 }