Package 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
,org.eigenbase.xom.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
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
BAD_ID
String
cdata
String
dot
String
space
protected int[]
templateNamePos
This is a one-to-one mapping, each template name can appear at most once.protected String[]
templateParts
-
Fields inherited from class mondrian.rolap.aggmatcher.DefaultDef.CaseMatcher
_charcase_values, charcase, id
-
Fields inherited from class mondrian.rolap.aggmatcher.DefaultDef.Base
enabled
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
display(PrintWriter _out, int _indent)
boolean
displayDiff(org.eigenbase.xom.ElementDef _other, PrintWriter _out, int _indent)
void
displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
String
getDot()
String
getName()
protected Pattern
getPattern(String[] names)
String
getRegex(String[] names)
String
getSpace()
String
getTemplate()
void
validate(DefaultDef.AggRules rules, String[] templateNames, MessageRecorder msgRecorder)
-
Methods inherited from class mondrian.rolap.aggmatcher.DefaultDef.CaseMatcher
getCharCase, getId, getTag, validate
-
Methods inherited from class mondrian.rolap.aggmatcher.DefaultDef.Base
isEnabled
-
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, getLocation, getMixedChildren, getMixedChildren_new, getText, getType, getWrapper, hashCode, toCompactXML, toString, toXML, verifyEqual
-
-
-
-
Field Detail
-
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.
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceorg.eigenbase.xom.NodeDef
- Overrides:
getName
in classDefaultDef.CaseMatcher
-
display
public void display(PrintWriter _out, int _indent)
- Specified by:
display
in interfaceorg.eigenbase.xom.NodeDef
- Overrides:
display
in classDefaultDef.CaseMatcher
-
displayXML
public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
- Specified by:
displayXML
in interfaceorg.eigenbase.xom.NodeDef
- Overrides:
displayXML
in classDefaultDef.CaseMatcher
-
displayDiff
public boolean displayDiff(org.eigenbase.xom.ElementDef _other, PrintWriter _out, int _indent)
- Overrides:
displayDiff
in classDefaultDef.CaseMatcher
-
getSpace
public String getSpace()
-
getDot
public String getDot()
-
getTemplate
public String getTemplate()
-
validate
public void validate(DefaultDef.AggRules rules, String[] templateNames, MessageRecorder msgRecorder)
-
-