/* // This java file was automatically generated // from mining model 'meta' // on Wed Jan 16 05:38:58 PST 2002 // Do not edit this file by hand. */ package mondrian.xom; /** * This model is the Mining Meta Model. It is the specification of the model used * to define new XML-based models. It is also an instance of itself. * <p>This class was generated from mining model 'meta' on Wed Jan 16 05:38:58 PST 2002 */ public class MetaDef { public static java.lang.Class getXMLDefClass() { return MetaDef.class; } public static String[] _elements = { "Model", "Definition", "FullDefinition", "Element", "Class", "StringElement", "Plugin", "Import", "Doc", "Code", "Attribute", "Value", "Content", "Object", "Array", "Any", "CData" }; /** * Model is the top-level element for a model description. The model element * contains all other elements in the model and also defines the model's * basic attributes, such as its name and version number. */ public static class Model extends mondrian.xom.ElementDef { public Model() { } public Model(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", MetaDef.class); _parser = _parser; mondrian.xom.NodeDef[] _tempArray = null; _tempArray = _tempArray; name = (String)_parser.getAttribute("name", "String", "", null, true); dtdName = (String)_parser.getAttribute("dtdName", "String", null, null, false); className = (String)_parser.getAttribute("className", "String", null, null, false); packageName = (String)_parser.getAttribute("packageName", "String", null, null, false); root = (String)_parser.getAttribute("root", "String", "", null, true); prefix = (String)_parser.getAttribute("prefix", "String", null, null, false); version = (Double)_parser.getAttribute("version", "Double", null, null, true); doc = _parser.getString(Doc, false); _tempArray = _parser.getArray(Definition.class, 1, 0); elements = new Definition[_tempArray.length]; for(int _i=0; _i<elements.length; _i++) elements[_i] = (Definition)_tempArray[_i]; } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } public String name; // required attribute public String dtdName; // optional attribute public String className; // optional attribute public String packageName; // optional attribute public String root; // required attribute public String prefix; // optional attribute public Double version; // required attribute public String doc; //optional element /** * The elements array contains a definition for each element within the * model. Elements include Class, Element, and String definitions. */ public Definition[] elements; //min 1 public String getName() { return "Model"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayAttribute(_out, "name", name, _indent+1); displayAttribute(_out, "dtdName", dtdName, _indent+1); displayAttribute(_out, "className", className, _indent+1); displayAttribute(_out, "packageName", packageName, _indent+1); displayAttribute(_out, "root", root, _indent+1); displayAttribute(_out, "prefix", prefix, _indent+1); displayAttribute(_out, "version", version, _indent+1); displayString(_out, "doc", doc, _indent+1); displayElementArray(_out, "elements", elements, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("Model", new mondrian.xom.XMLAttrVector() .add("name", name) .add("dtdName", dtdName) .add("className", className) .add("packageName", packageName) .add("root", root) .add("prefix", prefix) .add("version", version) ); displayXMLString(_out, "Doc", doc); displayXMLElementArray(_out, elements); _out.endTag("Model"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; Model _cother = (Model)_other; _diff = _diff && displayAttributeDiff("name", name, _cother.name, _out, _indent+1); _diff = _diff && displayAttributeDiff("dtdName", dtdName, _cother.dtdName, _out, _indent+1); _diff = _diff && displayAttributeDiff("className", className, _cother.className, _out, _indent+1); _diff = _diff && displayAttributeDiff("packageName", packageName, _cother.packageName, _out, _indent+1); _diff = _diff && displayAttributeDiff("root", root, _cother.root, _out, _indent+1); _diff = _diff && displayAttributeDiff("prefix", prefix, _cother.prefix, _out, _indent+1); _diff = _diff && displayAttributeDiff("version", version, _cother.version, _out, _indent+1); _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); _diff = _diff && displayElementArrayDiff("elements", elements, _cother.elements, _out, _indent+1); return _diff; } } /** * The Definition class represents a generic type of element definition. * The actual definition may be of a Class, Element, or String. * Definitions are the basic building blocks of a model. */ public static abstract class Definition extends mondrian.xom.ElementDef { public Definition() { } public Definition(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", MetaDef.class); _parser = _parser; doc = _parser.getString(Doc, false); } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } /** * Doc tags allow documentation to be added to any definition. The * documentation will automatically appear in all physical forms * of this model, including dtds, java classes, and the xsl * transformation. */ public String doc; //optional element public String getName() { return "Definition"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayString(_out, "doc", doc, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("(%Definition;)", new mondrian.xom.XMLAttrVector() ); displayXMLString(_out, "Doc", doc); _out.endTag("(%Definition;)"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; Definition _cother = (Definition)_other; _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); return _diff; } } /** * The FullDefinition class represents a fully-specified definition * that may include content. */ public static abstract class FullDefinition extends Definition { public FullDefinition() { } public FullDefinition(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", MetaDef.class); _parser = _parser; mondrian.xom.NodeDef[] _tempArray = null; _tempArray = _tempArray; String[] _contentModel_values = {"sequential", "random", "mixed", "any", "cdata"}; contentModel = (String)_parser.getAttribute("contentModel", "String", "sequential", _contentModel_values, false); keepDef = (Boolean)_parser.getAttribute("keepDef", "Boolean", "false", null, false); doc = _parser.getString(Doc, false); _tempArray = _parser.getArray(Attribute.class, 0, 0); attributes = new Attribute[_tempArray.length]; for(int _i=0; _i<attributes.length; _i++) attributes[_i] = (Attribute)_tempArray[_i]; _tempArray = _parser.getArray(Content.class, 0, 0); content = new Content[_tempArray.length]; for(int _i=0; _i<content.length; _i++) content[_i] = (Content)_tempArray[_i]; any = (Any)_parser.getElement(Any.class, false); cdata = (CData)_parser.getElement(CData.class, false); code = _parser.getString(Code, false); } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } public String contentModel; // attribute default: sequential public Boolean keepDef; // attribute default: false /** * This array defines all attributes to appear within this class or * element. */ public Attribute[] attributes; //optional array /** * This array defines all content (objects and arrays) to appear within * this class or element. The interpretation of this array depends * on the element's defined content model. */ public Content[] content; //optional array public Any any; //optional element public CData cdata; //optional element /** * This element allows arbitrary Java Code to be attached to any * class or element. Code sections are not verified until the final * .java class is compiled and should be used sparingly. */ public String code; //optional element public String getName() { return "FullDefinition"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayAttribute(_out, "contentModel", contentModel, _indent+1); displayAttribute(_out, "keepDef", keepDef, _indent+1); displayString(_out, "doc", doc, _indent+1); displayElementArray(_out, "attributes", attributes, _indent+1); displayElementArray(_out, "content", content, _indent+1); displayElement(_out, "any", any, _indent+1); displayElement(_out, "cdata", cdata, _indent+1); displayString(_out, "code", code, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("(%FullDefinition;)", new mondrian.xom.XMLAttrVector() .add("contentModel", contentModel) .add("keepDef", keepDef) ); displayXMLString(_out, "Doc", doc); displayXMLElementArray(_out, attributes); displayXMLElementArray(_out, content); displayXMLElement(_out, any); displayXMLElement(_out, cdata); displayXMLString(_out, "Code", code); _out.endTag("(%FullDefinition;)"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; FullDefinition _cother = (FullDefinition)_other; _diff = _diff && displayAttributeDiff("contentModel", contentModel, _cother.contentModel, _out, _indent+1); _diff = _diff && displayAttributeDiff("keepDef", keepDef, _cother.keepDef, _out, _indent+1); _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); _diff = _diff && displayElementArrayDiff("attributes", attributes, _cother.attributes, _out, _indent+1); _diff = _diff && displayElementArrayDiff("content", content, _cother.content, _out, _indent+1); _diff = _diff && displayElementDiff("any", any, _cother.any, _out, _indent+1); _diff = _diff && displayElementDiff("cdata", cdata, _cother.cdata, _out, _indent+1); _diff = _diff && displayStringDiff("code", code, _cother.code, _out, _indent+1); return _diff; } } /** * An Element Definition defines a basic entity of the meta model. Elements * are containers for two types of data: attributes and content. Attributes * are simple name/value pairs which may take on the full range of Java * types. Content consists of other Elements and Strings, either * appearing alone or as arrays. */ public static class Element extends FullDefinition { public Element() { } public Element(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", MetaDef.class); _parser = _parser; mondrian.xom.NodeDef[] _tempArray = null; _tempArray = _tempArray; type = (String)_parser.getAttribute("type", "String", "", null, true); _class = (String)_parser.getAttribute("class", "String", null, null, false); dtdName = (String)_parser.getAttribute("dtdName", "String", null, null, false); String[] _contentModel_values = {"sequential", "random", "mixed", "any", "cdata"}; contentModel = (String)_parser.getAttribute("contentModel", "String", "sequential", _contentModel_values, false); keepDef = (Boolean)_parser.getAttribute("keepDef", "Boolean", "false", null, false); doc = _parser.getString(Doc, false); _tempArray = _parser.getArray(Attribute.class, 0, 0); attributes = new Attribute[_tempArray.length]; for(int _i=0; _i<attributes.length; _i++) attributes[_i] = (Attribute)_tempArray[_i]; _tempArray = _parser.getArray(Content.class, 0, 0); content = new Content[_tempArray.length]; for(int _i=0; _i<content.length; _i++) content[_i] = (Content)_tempArray[_i]; any = (Any)_parser.getElement(Any.class, false); cdata = (CData)_parser.getElement(CData.class, false); code = _parser.getString(Code, false); } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } public String type; // required attribute public String _class; // optional attribute public String dtdName; // optional attribute public String getName() { return "Element"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayAttribute(_out, "type", type, _indent+1); displayAttribute(_out, "class", _class, _indent+1); displayAttribute(_out, "dtdName", dtdName, _indent+1); displayAttribute(_out, "contentModel", contentModel, _indent+1); displayAttribute(_out, "keepDef", keepDef, _indent+1); displayString(_out, "doc", doc, _indent+1); displayElementArray(_out, "attributes", attributes, _indent+1); displayElementArray(_out, "content", content, _indent+1); displayElement(_out, "any", any, _indent+1); displayElement(_out, "cdata", cdata, _indent+1); displayString(_out, "code", code, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("Element", new mondrian.xom.XMLAttrVector() .add("type", type) .add("class", _class) .add("dtdName", dtdName) .add("contentModel", contentModel) .add("keepDef", keepDef) ); displayXMLString(_out, "Doc", doc); displayXMLElementArray(_out, attributes); displayXMLElementArray(_out, content); displayXMLElement(_out, any); displayXMLElement(_out, cdata); displayXMLString(_out, "Code", code); _out.endTag("Element"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; Element _cother = (Element)_other; _diff = _diff && displayAttributeDiff("type", type, _cother.type, _out, _indent+1); _diff = _diff && displayAttributeDiff("class", _class, _cother._class, _out, _indent+1); _diff = _diff && displayAttributeDiff("dtdName", dtdName, _cother.dtdName, _out, _indent+1); _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); _diff = _diff && displayElementArrayDiff("attributes", attributes, _cother.attributes, _out, _indent+1); _diff = _diff && displayElementArrayDiff("content", content, _cother.content, _out, _indent+1); _diff = _diff && displayElementDiff("any", any, _cother.any, _out, _indent+1); _diff = _diff && displayElementDiff("cdata", cdata, _cother.cdata, _out, _indent+1); _diff = _diff && displayStringDiff("code", code, _cother.code, _out, _indent+1); return _diff; } } /** * A Class Definition defines a class of entities. A class specifies a group * of entities with similar properties. Full inheritence is supported, * although there are limits on what can be overridden. */ public static class Class extends FullDefinition { public Class() { } public Class(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", MetaDef.class); _parser = _parser; mondrian.xom.NodeDef[] _tempArray = null; _tempArray = _tempArray; _class = (String)_parser.getAttribute("class", "String", "", null, true); superclass = (String)_parser.getAttribute("superclass", "String", null, null, false); String[] _contentModel_values = {"sequential", "random", "mixed", "any", "cdata"}; contentModel = (String)_parser.getAttribute("contentModel", "String", "sequential", _contentModel_values, false); keepDef = (Boolean)_parser.getAttribute("keepDef", "Boolean", "false", null, false); doc = _parser.getString(Doc, false); _tempArray = _parser.getArray(Attribute.class, 0, 0); attributes = new Attribute[_tempArray.length]; for(int _i=0; _i<attributes.length; _i++) attributes[_i] = (Attribute)_tempArray[_i]; _tempArray = _parser.getArray(Content.class, 0, 0); content = new Content[_tempArray.length]; for(int _i=0; _i<content.length; _i++) content[_i] = (Content)_tempArray[_i]; any = (Any)_parser.getElement(Any.class, false); cdata = (CData)_parser.getElement(CData.class, false); code = _parser.getString(Code, false); } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } public String _class; // required attribute public String superclass; // optional attribute public String getName() { return "Class"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayAttribute(_out, "class", _class, _indent+1); displayAttribute(_out, "superclass", superclass, _indent+1); displayAttribute(_out, "contentModel", contentModel, _indent+1); displayAttribute(_out, "keepDef", keepDef, _indent+1); displayString(_out, "doc", doc, _indent+1); displayElementArray(_out, "attributes", attributes, _indent+1); displayElementArray(_out, "content", content, _indent+1); displayElement(_out, "any", any, _indent+1); displayElement(_out, "cdata", cdata, _indent+1); displayString(_out, "code", code, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("Class", new mondrian.xom.XMLAttrVector() .add("class", _class) .add("superclass", superclass) .add("contentModel", contentModel) .add("keepDef", keepDef) ); displayXMLString(_out, "Doc", doc); displayXMLElementArray(_out, attributes); displayXMLElementArray(_out, content); displayXMLElement(_out, any); displayXMLElement(_out, cdata); displayXMLString(_out, "Code", code); _out.endTag("Class"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; Class _cother = (Class)_other; _diff = _diff && displayAttributeDiff("class", _class, _cother._class, _out, _indent+1); _diff = _diff && displayAttributeDiff("superclass", superclass, _cother.superclass, _out, _indent+1); _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); _diff = _diff && displayElementArrayDiff("attributes", attributes, _cother.attributes, _out, _indent+1); _diff = _diff && displayElementArrayDiff("content", content, _cother.content, _out, _indent+1); _diff = _diff && displayElementDiff("any", any, _cother.any, _out, _indent+1); _diff = _diff && displayElementDiff("cdata", cdata, _cother.cdata, _out, _indent+1); _diff = _diff && displayStringDiff("code", code, _cother.code, _out, _indent+1); return _diff; } } /** * A StringElement is a simple type of element which has no attributes and * whose content is a single String (usually represented as a CDATA section). * StringElements are used when raw text must be included in a model, such * as raw Java code, or SQL statements, or HTML documentation. */ public static class StringElement extends Definition { public StringElement() { } public StringElement(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", MetaDef.class); _parser = _parser; type = (String)_parser.getAttribute("type", "String", "", null, true); doc = _parser.getString(Doc, false); } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } public String type; // required attribute public String getName() { return "StringElement"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayAttribute(_out, "type", type, _indent+1); displayString(_out, "doc", doc, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("StringElement", new mondrian.xom.XMLAttrVector() .add("type", type) ); displayXMLString(_out, "Doc", doc); _out.endTag("StringElement"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; StringElement _cother = (StringElement)_other; _diff = _diff && displayAttributeDiff("type", type, _cother.type, _out, _indent+1); _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); return _diff; } } /** * A Plugin in a special type of element whose content may be derived from * a different model. The exact model to use is specified by the * individual XML file, allowing a Plugin element to link to another * model dynamically. The Plugin element automatically defines the * defPackage and defClass attributes. Other attributes may be added * as needed. Code and documentation sections are supported as well. */ public static class Plugin extends Definition { public Plugin() { } public Plugin(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", MetaDef.class); _parser = _parser; mondrian.xom.NodeDef[] _tempArray = null; _tempArray = _tempArray; type = (String)_parser.getAttribute("type", "String", "", null, true); _class = (String)_parser.getAttribute("class", "String", null, null, false); doc = _parser.getString(Doc, false); _tempArray = _parser.getArray(Attribute.class, 0, 0); attributes = new Attribute[_tempArray.length]; for(int _i=0; _i<attributes.length; _i++) attributes[_i] = (Attribute)_tempArray[_i]; code = _parser.getString(Code, false); } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } public String type; // required attribute public String _class; // optional attribute public Attribute[] attributes; //optional array public String code; //optional element public String getName() { return "Plugin"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayAttribute(_out, "type", type, _indent+1); displayAttribute(_out, "class", _class, _indent+1); displayString(_out, "doc", doc, _indent+1); displayElementArray(_out, "attributes", attributes, _indent+1); displayString(_out, "code", code, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("Plugin", new mondrian.xom.XMLAttrVector() .add("type", type) .add("class", _class) ); displayXMLString(_out, "Doc", doc); displayXMLElementArray(_out, attributes); displayXMLString(_out, "Code", code); _out.endTag("Plugin"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; Plugin _cother = (Plugin)_other; _diff = _diff && displayAttributeDiff("type", type, _cother.type, _out, _indent+1); _diff = _diff && displayAttributeDiff("class", _class, _cother._class, _out, _indent+1); _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); _diff = _diff && displayElementArrayDiff("attributes", attributes, _cother.attributes, _out, _indent+1); _diff = _diff && displayStringDiff("code", code, _cother.code, _out, _indent+1); return _diff; } } /** * An Import as a special type of element that represents another element * stored in an external model. The model to use is specified by the * defPackage and defClass attributes of the import. * An Import may not be derived from any class. */ public static class Import extends Definition { public Import() { } public Import(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", MetaDef.class); _parser = _parser; type = (String)_parser.getAttribute("type", "String", "", null, true); defPackage = (String)_parser.getAttribute("defPackage", "String", "Broadbase.mining.xml", null, false); defClass = (String)_parser.getAttribute("defClass", "String", "", null, true); dtdName = (String)_parser.getAttribute("dtdName", "String", null, null, false); doc = _parser.getString(Doc, false); } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } public String type; // required attribute public String defPackage; // attribute default: Broadbase.mining.xml public String defClass; // required attribute public String dtdName; // optional attribute public String getName() { return "Import"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayAttribute(_out, "type", type, _indent+1); displayAttribute(_out, "defPackage", defPackage, _indent+1); displayAttribute(_out, "defClass", defClass, _indent+1); displayAttribute(_out, "dtdName", dtdName, _indent+1); displayString(_out, "doc", doc, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("Import", new mondrian.xom.XMLAttrVector() .add("type", type) .add("defPackage", defPackage) .add("defClass", defClass) .add("dtdName", dtdName) ); displayXMLString(_out, "Doc", doc); _out.endTag("Import"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; Import _cother = (Import)_other; _diff = _diff && displayAttributeDiff("type", type, _cother.type, _out, _indent+1); _diff = _diff && displayAttributeDiff("defPackage", defPackage, _cother.defPackage, _out, _indent+1); _diff = _diff && displayAttributeDiff("defClass", defClass, _cother.defClass, _out, _indent+1); _diff = _diff && displayAttributeDiff("dtdName", dtdName, _cother.dtdName, _out, _indent+1); _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); return _diff; } } /** * The Doc entity specifies a documentation section. The text contained * in this element should be raw text or HTML used to document the object * in which the Doc section appears. */ public static final String Doc = "Doc"; /** * The Code entity specifies a raw block of Java code. Each Class/Element * becomes represented by a Java Class. Including a Code block inside * a Class or Element will insert the code directly into the corresponding * class. No checking is done on the code until it is complied later. */ public static final String Code = "Code"; /** * The Attribute entity appears within any Element definition. It defines * an Attribute, which is a name/value pair used to hold data inside of an * Element. The Attribute's definition includes its name, type, and * usage information (default value and whether or not it is required). * An Attribute definition may limit its values by specifying Value * objects. */ public static class Attribute extends mondrian.xom.ElementDef { public Attribute() { } public Attribute(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", MetaDef.class); _parser = _parser; mondrian.xom.NodeDef[] _tempArray = null; _tempArray = _tempArray; name = (String)_parser.getAttribute("name", "String", "", null, true); type = (String)_parser.getAttribute("type", "String", "String", null, false); required = (Boolean)_parser.getAttribute("required", "Boolean", "false", null, false); _default = (String)_parser.getAttribute("default", "String", null, null, false); doc = _parser.getString(Doc, false); values = _parser.getStringArray("Value", 0, 0); } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } public String name; // required attribute public String type; // attribute default: String public Boolean required; // attribute default: false public String _default; // optional attribute public String doc; //optional element public String[] values; //optional array public String getName() { return "Attribute"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayAttribute(_out, "name", name, _indent+1); displayAttribute(_out, "type", type, _indent+1); displayAttribute(_out, "required", required, _indent+1); displayAttribute(_out, "default", _default, _indent+1); displayString(_out, "doc", doc, _indent+1); displayStringArray(_out, "values", values, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("Attribute", new mondrian.xom.XMLAttrVector() .add("name", name) .add("type", type) .add("required", required) .add("default", _default) ); displayXMLString(_out, "Doc", doc); displayXMLStringArray(_out, "Value", values); _out.endTag("Attribute"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; Attribute _cother = (Attribute)_other; _diff = _diff && displayAttributeDiff("name", name, _cother.name, _out, _indent+1); _diff = _diff && displayAttributeDiff("type", type, _cother.type, _out, _indent+1); _diff = _diff && displayAttributeDiff("required", required, _cother.required, _out, _indent+1); _diff = _diff && displayAttributeDiff("default", _default, _cother._default, _out, _indent+1); _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); _diff = _diff && displayStringArrayDiff("values", values, _cother.values, _out, _indent+1); return _diff; } } /** * The Value entity specifies a single value in the set of allowed values * for an Attribute. The value is specifies as text so that any special * characters may appear. */ public static final String Value = "Value"; /** * The Content class contains all entities which represent types of * content which may appear within an Element. Content includes * Objects, Arrays, Strings, and special markers such as Any. */ public static abstract class Content extends mondrian.xom.ElementDef { public Content() { } public Content(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { } public String getName() { return "Content"; } public void display(java.io.PrintWriter _out, int _indent) { } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("(%Content;)", new mondrian.xom.XMLAttrVector() ); _out.endTag("(%Content;)"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; return _diff; } } /** * An Object is a single instance of an Element type. Objects have an * identifying name and a type. The name identifies the object within * its Element and must be unique within the Element. The object is itself * an instance of an Element, and this Element is identified by the type. * The type may be the type name of an Element or the class name of a Class. */ public static class Object extends Content { public Object() { } public Object(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", MetaDef.class); _parser = _parser; name = (String)_parser.getAttribute("name", "String", "", null, true); type = (String)_parser.getAttribute("type", "String", "", null, true); required = (Boolean)_parser.getAttribute("required", "Boolean", "false", null, false); doc = _parser.getString(Doc, false); } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } public String name; // required attribute public String type; // required attribute public Boolean required; // attribute default: false public String doc; //optional element public String getName() { return "Object"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayAttribute(_out, "name", name, _indent+1); displayAttribute(_out, "type", type, _indent+1); displayAttribute(_out, "required", required, _indent+1); displayString(_out, "doc", doc, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("Object", new mondrian.xom.XMLAttrVector() .add("name", name) .add("type", type) .add("required", required) ); displayXMLString(_out, "Doc", doc); _out.endTag("Object"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; Object _cother = (Object)_other; _diff = _diff && displayAttributeDiff("name", name, _cother.name, _out, _indent+1); _diff = _diff && displayAttributeDiff("type", type, _cother.type, _out, _indent+1); _diff = _diff && displayAttributeDiff("required", required, _cother.required, _out, _indent+1); _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); return _diff; } } /** * An Array is a set of multiple instances of Elements. The Array * has an identifying name and a base type. The name identifies the array * within its Element and must be unique within the Element. Each object * in the array is an instance of the Element identified by the type. * The type may be the type name of an Element or the class name of a Class. */ public static class Array extends Content { public Array() { } public Array(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", MetaDef.class); _parser = _parser; name = (String)_parser.getAttribute("name", "String", "", null, true); type = (String)_parser.getAttribute("type", "String", "", null, true); min = (Integer)_parser.getAttribute("min", "Integer", "0", null, false); max = (Integer)_parser.getAttribute("max", "Integer", "0", null, false); doc = _parser.getString(Doc, false); } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } public String name; // required attribute public String type; // required attribute public Integer min; // attribute default: 0 public Integer max; // attribute default: 0 public String doc; //optional element public String getName() { return "Array"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayAttribute(_out, "name", name, _indent+1); displayAttribute(_out, "type", type, _indent+1); displayAttribute(_out, "min", min, _indent+1); displayAttribute(_out, "max", max, _indent+1); displayString(_out, "doc", doc, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("Array", new mondrian.xom.XMLAttrVector() .add("name", name) .add("type", type) .add("min", min) .add("max", max) ); displayXMLString(_out, "Doc", doc); _out.endTag("Array"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; Array _cother = (Array)_other; _diff = _diff && displayAttributeDiff("name", name, _cother.name, _out, _indent+1); _diff = _diff && displayAttributeDiff("type", type, _cother.type, _out, _indent+1); _diff = _diff && displayAttributeDiff("min", min, _cother.min, _out, _indent+1); _diff = _diff && displayAttributeDiff("max", max, _cother.max, _out, _indent+1); _diff = _diff && displayStringDiff("doc", doc, _cother.doc, _out, _indent+1); return _diff; } } /** * The Any content is a special marker which allows an Element to * contain any type of data. The data will appear in a single * array called "children". The data will contain all kinds of * node (elements, comments, text) if the content model is * "mixed", otherwise just elements. If an Any marker appears, no other * content may appear in the element. */ public static class Any extends Content { public Any() { } public Any(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { } public String getName() { return "Any"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("Any", new mondrian.xom.XMLAttrVector() ); _out.endTag("Any"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; return _diff; } } /** * The CData content is a special marker which allows an Element to * contain a single CDATA section as its only content, yet still * have attributes. The data will appear in a single String * called "cdata". If a CData marker appears, no other * content may appear in the element. */ public static class CData extends Content { public CData() { } public CData(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { } public String getName() { return "CData"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("CData", new mondrian.xom.XMLAttrVector() ); _out.endTag("CData"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; return _diff; } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 1501 | Julian Hyde |
Mondrian: generate MetaDef.java; fix home page link. |
||
#1 | 1453 | Julian Hyde | mondrian: first source check-in |