@ SuppressWarnings ( "unchecked" ) // NOSONAR (Avoid Duplicate Literals) private void processAllRulesWithEachResultHandler ( RI ruleInput ) { // For each rule List < Object > combinedRulesOutput = new ArrayList < Object > ( rules . size ( ) ) ; for ( Rule < RI , RO > rule : rules ) { // Validate the data and get the rule output Object data = rule . validate ( ruleInput ) ; // Transform the rule output if ( ruleOutputTransformers != null ) { for ( Transformer transformer : ruleOutputTransformers ) { data = transformer . transform ( data ) ; } } // Put the transformed rule output in a list combinedRulesOutput . add ( data ) ; } // Transform the list of transformed rule output to result handler input Object ruleOutput = combinedRulesOutput ; if ( resultHandlerInputTransformers != null ) { for ( Transformer transformer : resultHandlerInputTransformers ) { ruleOutput = transformer . transform ( ruleOutput ) ; } } RHI resultHandlerInput = ( RHI ) ruleOutput ; // Process the result handler input with the result handlers processResultHandlers ( resultHandlerInput ) ; }
Processes the specified rule input with each rule and processes the result of all rules all at once with each result handler .