/* // This java file was automatically generated // from mining model 'resource' // on Thu Jan 17 02:09:38 PST 2002 // Do not edit this file by hand. */ package mondrian.resource; /** * This model specifies the elements which make up a Foundation resource file. * <p>This class was generated from mining model 'resource' on Thu Jan 17 02:09:40 PST 2002 */ public class ResourceDef { public static java.lang.Class getXMLDefClass() { return ResourceDef.class; } public static String[] _elements = { "BaflResourceList", "Code", "BaflResourceText" }; /** * todo: */ public static class BaflResourceList extends mondrian.xom.ElementDef { public BaflResourceList() { } public BaflResourceList(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", ResourceDef.class); _parser = _parser; mondrian.xom.NodeDef[] _tempArray = null; _tempArray = _tempArray; packageName = (String)_parser.getAttribute("packageName", "String", "", null, true); className = (String)_parser.getAttribute("className", "String", "", null, true); contextParams = (String)_parser.getAttribute("contextParams", "String", null, null, false); contextArgs = (String)_parser.getAttribute("contextArgs", "String", null, null, false); generateNew = (Boolean)_parser.getAttribute("generateNew", "Boolean", "false", null, false); generateThrowProcess = (Boolean)_parser.getAttribute("generateThrowProcess", "Boolean", "true", null, false); errorClass = (String)_parser.getAttribute("errorClass", "String", "mondrian.resource.Error", null, false); baseClass = (String)_parser.getAttribute("baseClass", "String", null, null, false); label = (String)_parser.getAttribute("label", "String", null, null, false); locale = (String)_parser.getAttribute("locale", "String", null, null, false); _tempArray = _parser.getArray(BaflResourceText.class, 0, 0); resources = new BaflResourceText[_tempArray.length]; for(int _i=0; _i<resources.length; _i++) resources[_i] = (BaflResourceText)_tempArray[_i]; code = (Code)_parser.getElement(Code.class, false); } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } public String packageName; // required attribute public String className; // required attribute public String contextParams; // optional attribute public String contextArgs; // optional attribute public Boolean generateNew; // attribute default: false public Boolean generateThrowProcess; // attribute default: true public String errorClass; // attribute default: mondrian.resource.Error public String baseClass; // optional attribute public String label; // optional attribute public String locale; // optional attribute public BaflResourceText[] resources; //optional array /** * Text within this element is included in the generated class. */ public Code code; //optional element public String getName() { return "BaflResourceList"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayAttribute(_out, "packageName", packageName, _indent+1); displayAttribute(_out, "className", className, _indent+1); displayAttribute(_out, "contextParams", contextParams, _indent+1); displayAttribute(_out, "contextArgs", contextArgs, _indent+1); displayAttribute(_out, "generateNew", generateNew, _indent+1); displayAttribute(_out, "generateThrowProcess", generateThrowProcess, _indent+1); displayAttribute(_out, "errorClass", errorClass, _indent+1); displayAttribute(_out, "baseClass", baseClass, _indent+1); displayAttribute(_out, "label", label, _indent+1); displayAttribute(_out, "locale", locale, _indent+1); displayElementArray(_out, "resources", resources, _indent+1); displayElement(_out, "code", code, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("BaflResourceList", new mondrian.xom.XMLAttrVector() .add("packageName", packageName) .add("className", className) .add("contextParams", contextParams) .add("contextArgs", contextArgs) .add("generateNew", generateNew) .add("generateThrowProcess", generateThrowProcess) .add("errorClass", errorClass) .add("baseClass", baseClass) .add("label", label) .add("locale", locale) ); displayXMLElementArray(_out, resources); displayXMLElement(_out, code); _out.endTag("BaflResourceList"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; BaflResourceList _cother = (BaflResourceList)_other; _diff = _diff && displayAttributeDiff("packageName", packageName, _cother.packageName, _out, _indent+1); _diff = _diff && displayAttributeDiff("className", className, _cother.className, _out, _indent+1); _diff = _diff && displayAttributeDiff("contextParams", contextParams, _cother.contextParams, _out, _indent+1); _diff = _diff && displayAttributeDiff("contextArgs", contextArgs, _cother.contextArgs, _out, _indent+1); _diff = _diff && displayAttributeDiff("generateNew", generateNew, _cother.generateNew, _out, _indent+1); _diff = _diff && displayAttributeDiff("generateThrowProcess", generateThrowProcess, _cother.generateThrowProcess, _out, _indent+1); _diff = _diff && displayAttributeDiff("errorClass", errorClass, _cother.errorClass, _out, _indent+1); _diff = _diff && displayAttributeDiff("baseClass", baseClass, _cother.baseClass, _out, _indent+1); _diff = _diff && displayAttributeDiff("label", label, _cother.label, _out, _indent+1); _diff = _diff && displayAttributeDiff("locale", locale, _cother.locale, _out, _indent+1); _diff = _diff && displayElementArrayDiff("resources", resources, _cother.resources, _out, _indent+1); _diff = _diff && displayElementDiff("code", code, _cother.code, _out, _indent+1); return _diff; } } public static class Code extends mondrian.xom.ElementDef { public Code() { } public Code(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", ResourceDef.class); _parser = _parser; cdata = _parser.getText(); } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } public String cdata; // All text goes here public String getName() { return "Code"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayString(_out, "cdata", cdata, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("Code", new mondrian.xom.XMLAttrVector() ); _out.cdata(cdata); _out.endTag("Code"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; Code _cother = (Code)_other; _diff = _diff && displayStringDiff("cdata", cdata, _cother.cdata, _out, _indent+1); return _diff; } } /** * todo: */ public static class BaflResourceText extends mondrian.xom.ElementDef { public BaflResourceText() { } public BaflResourceText(mondrian.xom.DOMWrapper _def) throws mondrian.xom.XOMException { this._def = _def; try { mondrian.xom.DOMElementParser _parser = new mondrian.xom.DOMElementParser(_def, "", ResourceDef.class); _parser = _parser; id = (Integer)_parser.getAttribute("id", "Integer", null, null, true); macroName = (String)_parser.getAttribute("macroName", "String", "", null, true); String[] _type_values = {"i", "e", "n", "w"}; type = (String)_parser.getAttribute("type", "String", "i", _type_values, false); context = (Boolean)_parser.getAttribute("context", "Boolean", "false", null, false); cdata = _parser.getText(); } catch(mondrian.xom.XOMException _ex) { throw new mondrian.xom.XOMException("In " + getName() + ": " + _ex.getMessage()); } } public Integer id; // required attribute public String macroName; // required attribute public String type; // attribute default: i public Boolean context; // attribute default: false public mondrian.xom.DOMWrapper _def; public String cdata; // All text goes here public String getName() { return "BaflResourceText"; } public void display(java.io.PrintWriter _out, int _indent) { _out.println(getName()); displayAttribute(_out, "id", id, _indent+1); displayAttribute(_out, "macroName", macroName, _indent+1); displayAttribute(_out, "type", type, _indent+1); displayAttribute(_out, "context", context, _indent+1); displayString(_out, "cdata", cdata, _indent+1); } public void displayXML(mondrian.xom.XMLOutput _out, int _indent) { _out.beginTag("BaflResourceText", new mondrian.xom.XMLAttrVector() .add("id", id) .add("macroName", macroName) .add("type", type) .add("context", context) ); _out.cdata(cdata); _out.endTag("BaflResourceText"); } public boolean displayDiff(mondrian.xom.ElementDef _other, java.io.PrintWriter _out, int _indent) { boolean _diff = true; BaflResourceText _cother = (BaflResourceText)_other; _diff = _diff && displayAttributeDiff("id", id, _cother.id, _out, _indent+1); _diff = _diff && displayAttributeDiff("macroName", macroName, _cother.macroName, _out, _indent+1); _diff = _diff && displayAttributeDiff("type", type, _cother.type, _out, _indent+1); _diff = _diff && displayAttributeDiff("context", context, _cother.context, _out, _indent+1); _diff = _diff && displayStringDiff("cdata", cdata, _cother.cdata, _out, _indent+1); return _diff; } // BEGIN pass-through code block --- public int getSeverity() { if (type.equals("i")) { return Resource.SEVERITY_INFO; } else if (type.equals("w")) { return Resource.SEVERITY_WARN; } else if (type.equals("n")) { return Resource.SEVERITY_NON_FATAL_ERR; } else { // "e" and everything else is an error return Resource.SEVERITY_ERR; } } // END pass-through code block --- } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 1499 | Julian Hyde |
Mondrian: Re-organize functions and type-checking Add mondrian.olap.fun package |
||
#1 | 1453 | Julian Hyde | mondrian: first source check-in |