@ Override public boolean validate ( XmlObject formObject , List < AuditError > errors , String formName ) { final List < String > formErrors = new ArrayList <> ( ) ; final boolean result = validateXml ( formObject , formErrors ) ; errors . addAll ( formErrors . stream ( ) . map ( validationError -> s2SErrorHandlerService . getError ( GRANTS_GOV_PREFIX + validationError , formName ) ) . collect ( Collectors . toList ( ) ) ) ; return result ; }
This method receives an XMLObject and validates it against its schema and returns the validation result . It also receives a list in which upon validation failure populates it with XPaths of the error nodes .