public void setDefaultRuleSet ( String ruleSetName ) { if ( ruleSetName == null ) { if ( publicRuleSetNames . length > 0 ) { defaultRuleSet = findRuleSet ( publicRuleSetNames [ 0 ] ) ; } else { defaultRuleSet = null ; int n = ruleSets . length ; while ( -- n >= 0 ) { String currentName = ruleSets [ n ] . getName ( ) ; if ( currentName . equals ( "%spellout-numbering" ) || currentName . equals ( "%digits-ordinal" ) || currentName . equals ( "%duration" ) ) { defaultRuleSet = ruleSets [ n ] ; return ; } } n = ruleSets . length ; while ( -- n >= 0 ) { if ( ruleSets [ n ] . isPublic ( ) ) { defaultRuleSet = ruleSets [ n ] ; break ; } } } } else if ( ruleSetName . startsWith ( "%%" ) ) { throw new IllegalArgumentException ( "cannot use private rule set: " + ruleSetName ) ; } else { defaultRuleSet = findRuleSet ( ruleSetName ) ; } }
Override the default rule set to use . If ruleSetName is null reset to the initial default rule set .