void setRuleArg ( XmlModelWriter xw , ValidatorRule rule , int argNum , Element element , String altMessageVar ) { Integer argPosition = new Integer ( argNum ) ; ValidatorRule . MessageArg arg = rule . getArg ( argPosition ) ; if ( arg != null || altMessageVar != null ) { String ruleName = rule . getRuleName ( ) ; Element argElementToUse = getArgElement ( xw , element , argNum , ruleName , true ) ; if ( arg != null ) { String argMessage = arg . getMessage ( ) ; String key = arg . isKey ( ) ? argMessage : ValidatorConstants . EXPRESSION_KEY_PREFIX + argMessage ; setElementAttribute ( argElementToUse , "key" , key ) ; setElementAttribute ( argElementToUse , "resource" , true ) ; if ( arg . isKey ( ) && _isValidatorOneOne ) { setElementAttribute ( argElementToUse , "bundle" , rule . getBundle ( ) ) ; } } else { altMessageVar = "${var:" + altMessageVar + ' ' ; setElementAttribute ( argElementToUse , "key" , altMessageVar ) ; setElementAttribute ( argElementToUse , "resource" , "false" ) ; } setElementAttribute ( argElementToUse , "name" , ruleName ) ; } }
Set up the desired &lt ; arg&gt ; element and attributes for the given rule .