private static void validate ( Properties props , Report report , List < Property > properties , PropertyScope ignoredScope ) { if ( null != properties ) { for ( final Property property : properties ) { if ( null != ignoredScope && property . getScope ( ) != null && property . getScope ( ) . compareTo ( ignoredScope ) <= 0 ) { continue ; } final String key = property . getName ( ) ; final String value = props . getProperty ( key ) ; if ( null == value || "" . equals ( value ) ) { if ( property . isRequired ( ) ) { report . errors . put ( key , "required" ) ; continue ; } } else { //try to validate final PropertyValidator validator = property . getValidator ( ) ; if ( null != validator ) { try { if ( ! validator . isValid ( value ) ) { report . errors . put ( key , "Invalid value: " + value ) ; } } catch ( ValidationException e ) { report . errors . put ( key , "Invalid value: " + e . getMessage ( ) ) ; } } } } } }
Validate ignoring properties below a scope if set