@ Override public boolean handleEvent ( ValidationEvent event ) { if ( event == null ) throw new IllegalArgumentException ( "No validation event was provided!" ) ; int line = - 1 ; int col = - 1 ; if ( event . getLocator ( ) != null ) { line = event . getLocator ( ) . getLineNumber ( ) ; col = event . getLocator ( ) . getColumnNumber ( ) ; } if ( ValidationEvent . FATAL_ERROR == event . getSeverity ( ) ) { LOGGER . warn ( "fatal validation error" ) ; if ( line > - 1 && col > - 1 ) LOGGER . warn ( "> at line " + line + " / column " + col ) ; LOGGER . warn ( "> " + event . getMessage ( ) ) ; return false ; } if ( ValidationEvent . WARNING == event . getSeverity ( ) ) { LOGGER . warn ( "validation warning" ) ; if ( line > - 1 && col > - 1 ) LOGGER . warn ( "> at line " + line + " / column " + col ) ; LOGGER . warn ( "> " + event . getMessage ( ) ) ; } else { LOGGER . warn ( "validation error" ) ; if ( line > - 1 && col > - 1 ) LOGGER . warn ( "> at line " + line + " / column " + col ) ; LOGGER . warn ( "> " + event . getMessage ( ) ) ; } return true ; }
Receive notification of a validation warning or error .