Class DefaultRules


  • public class DefaultRules
    extends java.lang.Object
    Container for the default aggregate recognition rules. It is generated by parsing the default rule xml information found in the MondrianProperties.AggregateRules value which normally is a resource in the jar file (but can be a url).

    It is a singleton since it is used to recognize tables independent of database connection (each RolapSchema uses the same instance).

    Author:
    Richard M. Emberson
    • Method Detail

      • makeAggRules

        protected static DefaultDef.AggRules makeAggRules​(java.io.InputStream inStream)
      • makeAggRules

        protected static DefaultDef.AggRules makeAggRules​(java.lang.String text,
                                                          java.lang.String name)
      • makeDOMWrapper

        protected static DOMWrapper makeDOMWrapper​(java.io.File file)
      • makeDOMWrapper

        protected static DOMWrapper makeDOMWrapper​(java.net.URL url)
      • makeDOMWrapper

        protected static DOMWrapper makeDOMWrapper​(java.io.InputStream inStream)
      • makeDOMWrapper

        protected static DOMWrapper makeDOMWrapper​(java.lang.String text,
                                                   java.lang.String name)
      • getAggRule

        public DefaultDef.AggRule getAggRule​(java.lang.String tag)
        Returns the DefaultDef.AggRule whose tag equals the parameter tag, or null if not found.
        Parameters:
        tag -
        Returns:
        the AggRule with tag value equal to tag parameter, or null.
      • getForeignKeyMatcher

        public Recognizer.Matcher getForeignKeyMatcher​(java.lang.String foreignKeyName)
        Gets the Recognizer.Matcher for this foreign key column name.
        Parameters:
        foreignKeyName - Name of a foreign key column
      • matchesTableName

        public boolean matchesTableName​(java.lang.String factTableName,
                                        java.lang.String name)
        Returns true if this candidate aggregate table name "matches" the factTableName.
        Parameters:
        factTableName - Name of the fact table
        name - candidate aggregate table name
      • getMeasureMatcher

        public Recognizer.Matcher getMeasureMatcher​(java.lang.String measureName,
                                                    java.lang.String measureColumnName,
                                                    java.lang.String aggregateName)
        Creates a Recognizer.Matcher for the given measure name (symbolic name), column name and aggregate name (sum, count, etc.).
      • getLevelMatcher

        public Recognizer.Matcher getLevelMatcher​(java.lang.String usagePrefix,
                                                  java.lang.String hierarchyName,
                                                  java.lang.String levelName,
                                                  java.lang.String levelColumnName)
        Gets a Recognizer.Matcher for a given level's hierarchy's name, level name and column name.