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
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:
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
protected int[]
This is a one-to-one mapping, each template name can appear at most once.protected String[]
Fields inherited from class mondrian.rolap.aggmatcher.DefaultDef.CaseMatcher
_charcase_values, charcase, id
Fields inherited from class mondrian.rolap.aggmatcher.DefaultDef.Base
enabled
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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) getDot()
getName()
protected Pattern
getPattern
(String[] names) getSpace()
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 Details
-
space
-
dot
-
cdata
-
BAD_ID
protected static final int BAD_ID- See Also:
-
templateParts
-
templateNamePos
protected int[] templateNamePosThis is a one-to-one mapping, each template name can appear at most once.
-
-
Constructor Details
-
Regex
public Regex() -
Regex
public Regex(org.eigenbase.xom.DOMWrapper _def) throws org.eigenbase.xom.XOMException - Throws:
org.eigenbase.xom.XOMException
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceorg.eigenbase.xom.NodeDef
- Overrides:
getName
in classDefaultDef.CaseMatcher
-
display
- 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
- Overrides:
displayDiff
in classDefaultDef.CaseMatcher
-
getSpace
-
getDot
-
getTemplate
-
validate
public void validate(DefaultDef.AggRules rules, String[] templateNames, MessageRecorder msgRecorder) -
getRegex
-
getPattern
-