public boolean validate ( ) { _validationError = null ; List < XmlError > errors = new ArrayList < XmlError > ( ) ; boolean valid = _xmlBean . validate ( new XmlOptions ( ) . setErrorListener ( errors ) ) ; if ( ! valid ) { _validationError = "" ; for ( int i = 0 ; i < errors . size ( ) ; i ++ ) { _validationError += errors . get ( i ) . toString ( ) ; if ( i < errors . size ( ) - 1 ) _validationError += ' ' ; } } return valid ; }
Performs validation on the XmlBean populating the error message if failed .