mondrian.rolap.aggmatcher
Class DefaultDef.Regex

java.lang.Object
  extended by org.eigenbase.xom.ElementDef
      extended by mondrian.rolap.aggmatcher.DefaultDef.Base
          extended by mondrian.rolap.aggmatcher.DefaultDef.CaseMatcher
              extended by 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
 

Field Summary
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
 
Constructor Summary
DefaultDef.Regex()
           
DefaultDef.Regex(DOMWrapper _def)
           
 
Method Summary
 void display(PrintWriter _out, int _indent)
           
 boolean displayDiff(ElementDef _other, PrintWriter _out, int _indent)
           
 void displayXML(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, getMixedChildren_new, getMixedChildren, getText, getType, getWrapper, hashCode, toCompactXML, toString, toXML, verifyEqual
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

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.

Constructor Detail

DefaultDef.Regex

public DefaultDef.Regex()

DefaultDef.Regex

public DefaultDef.Regex(DOMWrapper _def)
                 throws XOMException
Throws:
XOMException
Method Detail

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)

SourceForge.net_Logo