@Override public T inspect( T record, Connection conn, SQLDialect dialect ) throws MetadataInspectorException { List<SchemaValidationEvent> errors = validate( record.getAsOMElement() ); if ( errors.isEmpty() ) { return record; } else { StringBuilder sb = new StringBuilder(); for ( SchemaValidationEvent error : errors ) { sb.append( error ); sb.append( "\n" ); } String msg = Messages.getMessage( "ERROR_VALIDATE" + sb ); LOG.debug( msg ); throw new MetadataInspectorException( msg ); } } }