public void populateOperationOutcome ( IBaseOperationOutcome theOperationOutcome ) { for ( SingleValidationMessage next : myMessages ) { String location ; if ( isNotBlank ( next . getLocationString ( ) ) ) { location = next . getLocationString ( ) ; } else if ( next . getLocationLine ( ) != null || next . getLocationCol ( ) != null ) { location = "Line[" + next . getLocationLine ( ) + "] Col[" + next . getLocationCol ( ) + "]" ; } else { location = null ; } String severity = next . getSeverity ( ) != null ? next . getSeverity ( ) . getCode ( ) : null ; OperationOutcomeUtil . addIssue ( myCtx , theOperationOutcome , severity , next . getMessage ( ) , location , Constants . OO_INFOSTATUS_PROCESSING ) ; } if ( myMessages . isEmpty ( ) ) { String message = myCtx . getLocalizer ( ) . getMessage ( ValidationResult . class , "noIssuesDetected" ) ; OperationOutcomeUtil . addIssue ( myCtx , theOperationOutcome , "information" , message , null , "informational" ) ; } }
Populate an operation outcome with the results of the validation