defaultdef.java
来自「数据仓库展示程序」· Java 代码 · 共 1,687 行 · 第 1/5 页
JAVA
1,687 行
{
return "FactCountMatch";
}
public void display(java.io.PrintWriter _out, int _indent)
{
_out.println(getName());
displayAttribute(_out, "factCountName", factCountName, _indent+1);
displayAttribute(_out, "pretemplate", pretemplate, _indent+1);
displayAttribute(_out, "posttemplate", posttemplate, _indent+1);
displayAttribute(_out, "basename", basename, _indent+1);
displayAttribute(_out, "id", id, _indent+1);
displayAttribute(_out, "charcase", charcase, _indent+1);
displayAttribute(_out, "enabled", enabled, _indent+1);
}
public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
{
_out.beginTag("FactCountMatch", new org.eigenbase.xom.XMLAttrVector()
.add("factCountName", factCountName)
.add("pretemplate", pretemplate)
.add("posttemplate", posttemplate)
.add("basename", basename)
.add("id", id)
.add("charcase", charcase)
.add("enabled", enabled)
);
_out.endTag("FactCountMatch");
}
public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
{
boolean _diff = true;
FactCountMatch _cother = (FactCountMatch)_other;
_diff = _diff && displayAttributeDiff("factCountName", factCountName, _cother.factCountName, _out, _indent+1);
return _diff;
}
// BEGIN pass-through code block ---
public void validate(final AggRules rules,
final mondrian.recorder.MessageRecorder msgRecorder) {
msgRecorder.pushContextName(getName());
try {
super.validate(rules, msgRecorder);
} finally {
msgRecorder.popContextName();
}
}
public Recognizer.Matcher getMatcher() {
return super.getMatcher(factCountName);
}
// END pass-through code block ---
}
/**
* This is used to identify foreign key columns in a candidate
* aggregate table given the name of a foreign key column of the
* base fact table. This allows such foreign keys to be identified
* by using a regular exprsssion. The default is to simply
* match the base fact table's foreign key column name.
*/
public static class ForeignKeyMatch extends NameMatcher
{
public ForeignKeyMatch()
{
}
public ForeignKeyMatch(org.eigenbase.xom.DOMWrapper _def)
throws org.eigenbase.xom.XOMException
{
try {
org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", DefaultDef.class);
_parser = _parser;
pretemplate = (String)_parser.getAttribute("pretemplate", "String", null, null, false);
posttemplate = (String)_parser.getAttribute("posttemplate", "String", null, null, false);
basename = (String)_parser.getAttribute("basename", "String", null, null, false);
id = (String)_parser.getAttribute("id", "String", null, null, true);
charcase = (String)_parser.getAttribute("charcase", "String", "ignore", _charcase_values, false);
enabled = (Boolean)_parser.getAttribute("enabled", "Boolean", "true", null, false);
} catch(org.eigenbase.xom.XOMException _ex) {
throw new org.eigenbase.xom.XOMException("In element '" + getName() + "': " + _ex.getMessage());
}
}
public String getName()
{
return "ForeignKeyMatch";
}
public void display(java.io.PrintWriter _out, int _indent)
{
_out.println(getName());
displayAttribute(_out, "pretemplate", pretemplate, _indent+1);
displayAttribute(_out, "posttemplate", posttemplate, _indent+1);
displayAttribute(_out, "basename", basename, _indent+1);
displayAttribute(_out, "id", id, _indent+1);
displayAttribute(_out, "charcase", charcase, _indent+1);
displayAttribute(_out, "enabled", enabled, _indent+1);
}
public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
{
_out.beginTag("ForeignKeyMatch", new org.eigenbase.xom.XMLAttrVector()
.add("pretemplate", pretemplate)
.add("posttemplate", posttemplate)
.add("basename", basename)
.add("id", id)
.add("charcase", charcase)
.add("enabled", enabled)
);
_out.endTag("ForeignKeyMatch");
}
public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
{
boolean _diff = true;
ForeignKeyMatch _cother = (ForeignKeyMatch)_other;
return _diff;
}
// BEGIN pass-through code block ---
public void validate(final AggRules rules,
final mondrian.recorder.MessageRecorder msgRecorder) {
msgRecorder.pushContextName(getName());
try {
super.validate(rules, msgRecorder);
} finally {
msgRecorder.popContextName();
}
}
public Recognizer.Matcher getMatcher(final String foreignKeyName) {
return super.getMatcher(foreignKeyName);
}
// END pass-through code block ---
}
/**
* This is used to identify which tables in the database might
* be aggregate table of a given fact table.
* It is expected that aggregate table names will include the
* base fact table name with additional text before and/or
* after.
* It is not allow for both the prepending and appending
* regular expression text to be null (if it were, then only
* aggregate tables who names were the same as (modulo case)
* would match - which is surely not allowed).
*/
public static class TableMatch extends NameMatcher
{
public TableMatch()
{
}
public TableMatch(org.eigenbase.xom.DOMWrapper _def)
throws org.eigenbase.xom.XOMException
{
try {
org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", DefaultDef.class);
_parser = _parser;
pretemplate = (String)_parser.getAttribute("pretemplate", "String", null, null, false);
posttemplate = (String)_parser.getAttribute("posttemplate", "String", null, null, false);
basename = (String)_parser.getAttribute("basename", "String", null, null, false);
id = (String)_parser.getAttribute("id", "String", null, null, true);
charcase = (String)_parser.getAttribute("charcase", "String", "ignore", _charcase_values, false);
enabled = (Boolean)_parser.getAttribute("enabled", "Boolean", "true", null, false);
} catch(org.eigenbase.xom.XOMException _ex) {
throw new org.eigenbase.xom.XOMException("In element '" + getName() + "': " + _ex.getMessage());
}
}
public String getName()
{
return "TableMatch";
}
public void display(java.io.PrintWriter _out, int _indent)
{
_out.println(getName());
displayAttribute(_out, "pretemplate", pretemplate, _indent+1);
displayAttribute(_out, "posttemplate", posttemplate, _indent+1);
displayAttribute(_out, "basename", basename, _indent+1);
displayAttribute(_out, "id", id, _indent+1);
displayAttribute(_out, "charcase", charcase, _indent+1);
displayAttribute(_out, "enabled", enabled, _indent+1);
}
public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
{
_out.beginTag("TableMatch", new org.eigenbase.xom.XMLAttrVector()
.add("pretemplate", pretemplate)
.add("posttemplate", posttemplate)
.add("basename", basename)
.add("id", id)
.add("charcase", charcase)
.add("enabled", enabled)
);
_out.endTag("TableMatch");
}
public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
{
boolean _diff = true;
TableMatch _cother = (TableMatch)_other;
return _diff;
}
// BEGIN pass-through code block ---
public void validate(final AggRules rules,
final mondrian.recorder.MessageRecorder msgRecorder) {
msgRecorder.pushContextName(getName());
try {
if ((pretemplate == null) && (posttemplate == null)) {
String msg = "Must have at least one template non-null";
msgRecorder.reportError(msg);
}
super.validate(rules, msgRecorder);
} finally {
msgRecorder.popContextName();
}
}
public Recognizer.Matcher getMatcher(final String name) {
return super.getMatcher(name);
}
// END pass-through code block ---
}
/**
* This allows one to create an element that matches against a
* single template, where the template is an attribute.
* While much loved, this is currently not used.
*/
public static abstract class Mapper extends CaseMatcher
{
public Mapper()
{
}
public Mapper(org.eigenbase.xom.DOMWrapper _def)
throws org.eigenbase.xom.XOMException
{
try {
org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", DefaultDef.class);
_parser = _parser;
template = (String)_parser.getAttribute("template", "String", null, null, true);
space = (String)_parser.getAttribute("space", "String", "_", null, false);
dot = (String)_parser.getAttribute("dot", "String", "_", null, false);
id = (String)_parser.getAttribute("id", "String", null, null, true);
charcase = (String)_parser.getAttribute("charcase", "String", "ignore", _charcase_values, false);
enabled = (Boolean)_parser.getAttribute("enabled", "Boolean", "true", null, false);
} catch(org.eigenbase.xom.XOMException _ex) {
throw new org.eigenbase.xom.XOMException("In element '" + getName() + "': " + _ex.getMessage());
}
}
public String template; // required attribute
public String space; // attribute default: _
public String dot; // attribute default: _
public String getName()
{
return "Mapper";
}
public void display(java.io.PrintWriter _out, int _indent)
{
_out.println(getName());
displayAttribute(_out, "template", template, _indent+1);
displayAttribute(_out, "space", space, _indent+1);
displayAttribute(_out, "dot", dot, _indent+1);
displayAttribute(_out, "id", id, _indent+1);
displayAttribute(_out, "charcase", charcase, _indent+1);
displayAttribute(_out, "enabled", enabled, _indent+1);
}
public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
{
_out.beginTag("(%Mapper;)", new org.eigenbase.xom.XMLAttrVector()
.add("template", template)
.add("space", space)
.add("dot", dot)
.add("id", id)
.add("charcase", charcase)
.add("enabled", enabled)
);
_out.endTag("(%Mapper;)");
}
public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
{
boolean _diff = true;
Mapper _cother = (Mapper)_other;
_diff = _diff && displayAttributeDiff("template", template, _cother.template, _out, _indent+1);
_diff = _diff && displayAttributeDiff("space", space, _cother.space, _out, _indent+1);
_diff = _diff && displayAttributeDiff("dot", dot, _cother.dot, _out, _indent+1);
return _diff;
}
// BEGIN pass-through code block ---
public String getTemplate() {
return template;
}
public String getSpace() {
return space;
}
public String getDot() {
return dot;
}
protected static final int BAD_ID = -1;
protected String[] templateParts;
protected int[] templateNamePos;
/**
* It is hoped that no one will need to match more than 50 names
* in a template. Currently, this implementation, requires only 3.
*/
private static final int MAX_SIZE = 50;
public void validate(final AggRules rules,
final mondrian.recorder.MessageRecorder msgRecorder) {
msgRecorder.pushContextName(getName());
try {
super.validate(rules, msgRecorder);
String[] ss = new String[MAX_SIZE+1];
int[] poss = new int[MAX_SIZE];
String template = getTemplate();
int count = 0;
int end = 0;
int previousEnd = 0;
int start = template.indexOf("${", end);
while (count < MAX_SIZE) {
if (start == -1) {
if (count == 0) {
// there are no ${} in template which
// is an error
String msg = "Bad template \"" +
template +
"\", no ${} entries";
msgRecorder.reportError(msg);
return;
}
// its OK, there are "count" ${}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?