@ SuppressWarnings ( "unchecked" ) public ValidationPlanResult execute ( ValidationCheck check , Object target ) throws ValidationEngineException { if ( check == null ) { return validationPlanResult ; } try { check . setEmblEntryValidationPlanProperty ( planProperty ) ; if ( planProperty . enproConnection . get ( ) != null && entryDAOUtils == null ) { entryDAOUtils = new EntryDAOUtilsImpl ( planProperty . enproConnection . get ( ) , true ) ; } check . setEntryDAOUtils ( entryDAOUtils ) ; if ( planProperty . eraproConnection . get ( ) != null && eraproDAOUtils == null ) { eraproDAOUtils = new EraproDAOUtilsImpl ( planProperty . eraproConnection . get ( ) ) ; } check . setEraproDAOUtils ( eraproDAOUtils ) ; } catch ( Exception e ) { throw new ValidationEngineException ( e ) ; } //long start= System.currentTimeMillis(); Class < ? extends ValidationCheck > checkClass = check . getClass ( ) ; ExcludeScope excludeScopeAnnotation = checkClass . getAnnotation ( ExcludeScope . class ) ; RemoteExclude remoteExclude = checkClass . getAnnotation ( RemoteExclude . class ) ; Description descAnnotation = checkClass . getAnnotation ( Description . class ) ; GroupIncludeScope groupIncludeAnnotation = checkClass . getAnnotation ( GroupIncludeScope . class ) ; if ( remoteExclude != null && remote ) { return validationPlanResult ; } if ( excludeScopeAnnotation != null && isInValidationScope ( excludeScopeAnnotation . validationScope ( ) ) ) { return validationPlanResult ; } if ( groupIncludeAnnotation != null && ! isInValidationScopeGroup ( groupIncludeAnnotation . group ( ) ) ) { return validationPlanResult ; } // inject data sets /*if(null != checkDataSetAnnotation) { Stream.of(checkDataSetAnnotation.dataSetNames()).forEach( dsName -> GlobalDataSets.loadIfNotExist(dsName, dataManager, fileManager, devMode)); } */ validationPlanResult . append ( check . check ( target ) ) ; if ( excludeScopeAnnotation != null ) { demoteSeverity ( validationPlanResult , excludeScopeAnnotation . maxSeverity ( ) ) ; } if ( groupIncludeAnnotation != null ) { demoteSeverity ( validationPlanResult , groupIncludeAnnotation . maxSeverity ( ) ) ; } // System.out.println(this.result.count()); return validationPlanResult ; }
Executes a validation check .