mondrian.rolap.aggmatcher
Class DefaultDef.Regex
java.lang.Object
org.eigenbase.xom.ElementDef
mondrian.rolap.aggmatcher.DefaultDef.Base
mondrian.rolap.aggmatcher.DefaultDef.CaseMatcher
mondrian.rolap.aggmatcher.DefaultDef.Regex
- All Implemented Interfaces:
- Serializable, Cloneable, NodeDef
- Enclosing class:
- DefaultDef
public static class DefaultDef.Regex
- extends DefaultDef.CaseMatcher
This element is used in a vector of child elements when
one wishes to have one or more regular expressions associated
with matching a given string. The parent element must
initialize Regex object by calling its validate method
passing in an array of template names.
The cdata content is a regular expression with embedded
template names. Each name must be surrounded by "${" and "}".
Each time this is used for a new set of names, the names
replace the template names in the regular expression.
For example, if the charcase="lower", the attribute
dot="-" (the default dot value is "_"), the template names are:
"city", "state", and "country"
and the cdata is:
.*_${country}_.*_${city}
Then when the names:
"San Francisco", "California", and "U.S.A"
are passed in, the regular expression becomes:
.*_u-s-a_.*_san_francisco
Note that a given template name can only appear ONCE in the
template content, the cdata content. As an example, the
following cdata template is not supported:
.*_${country}_.*_${city}_${country}
- See Also:
- Serialized Form
-
-
Methods inherited from class org.eigenbase.xom.ElementDef |
addChild, addChildren, clone, constructElement, constructElement, deepCopy, diff, displayAttribute, displayAttributeDiff, displayElement, displayElementArray, displayElementArrayDiff, displayElementDiff, displayIndent, displayString, displayStringArray, displayStringArrayDiff, displayStringDiff, displayXML, displayXMLElement, displayXMLElementArray, displayXMLString, displayXMLStringArray, equals, getChildren, getElementChildren, getElementClass, getMixedChildren_new, getMixedChildren, getText, getType, getWrapper, hashCode, toCompactXML, toString, toXML, verifyEqual |
space
public String space
dot
public String dot
cdata
public String cdata
BAD_ID
protected static final int BAD_ID
- See Also:
- Constant Field Values
templateParts
protected String[] templateParts
templateNamePos
protected int[] templateNamePos
- This is a one-to-one mapping, each template name can appear
at most once.
DefaultDef.Regex
public DefaultDef.Regex()
DefaultDef.Regex
public DefaultDef.Regex(DOMWrapper _def)
throws XOMException
- Throws:
XOMException
getName
public String getName()
- Specified by:
getName
in interface NodeDef
- Overrides:
getName
in class DefaultDef.CaseMatcher
display
public void display(PrintWriter _out,
int _indent)
- Specified by:
display
in interface NodeDef
- Overrides:
display
in class DefaultDef.CaseMatcher
displayXML
public void displayXML(XMLOutput _out,
int _indent)
- Specified by:
displayXML
in interface NodeDef
- Overrides:
displayXML
in class DefaultDef.CaseMatcher
displayDiff
public boolean displayDiff(ElementDef _other,
PrintWriter _out,
int _indent)
- Overrides:
displayDiff
in class DefaultDef.CaseMatcher
getSpace
public String getSpace()
getDot
public String getDot()
getTemplate
public String getTemplate()
validate
public void validate(DefaultDef.AggRules rules,
String[] templateNames,
MessageRecorder msgRecorder)
getRegex
public String getRegex(String[] names)
getPattern
protected Pattern getPattern(String[] names)