Class CheckResourceLoader
- java.lang.Object
-
- org.openstreetmap.atlas.checks.base.CheckResourceLoader
-
public class CheckResourceLoader extends java.lang.ObjectLoads Checks found on the classpath. Checks are discovered by scanning a list of configurable classpath URLs for implementations of a specific type, which also configurable. Enabled checks found are instantiated and added to theSetof returned checks. Configuration:{ "CheckResourceLoader": { "scanUrls": [ "org.openstreetmap.atlas.checks" ], "type": "org.openstreetmap.atlas.checks.base.Check", "enabled": { "key.template": "%s.enabled", "value.default": false } } }
-
-
Constructor Summary
Constructors Constructor Description CheckResourceLoader(org.openstreetmap.atlas.utilities.configuration.Configuration configuration)Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.openstreetmap.atlas.utilities.configuration.ConfigurationgetConfiguration()org.openstreetmap.atlas.utilities.configuration.ConfigurationgetConfigurationForCountry(java.lang.String country)Get configuration for a specific country, overriding for country specific overrides and group specific overrides<T extends Check>
java.util.Set<T>loadChecks()Loads checks that are enabled by configuration<T extends Check>
java.util.Set<T>loadChecks(java.util.function.Predicate<java.lang.Class> isEnabled)<T extends Check>
java.util.Set<T>loadChecks(java.util.function.Predicate<java.lang.Class> isEnabled, org.openstreetmap.atlas.utilities.configuration.Configuration configuration)Loads checks that are enabled by some other means, defined byisEnabled<T extends Check>
java.util.Set<T>loadChecks(org.openstreetmap.atlas.utilities.configuration.Configuration configuration)<T extends Check>
java.util.Set<T>loadChecksForCountry(java.lang.String country)
-
-
-
Method Detail
-
getConfiguration
public org.openstreetmap.atlas.utilities.configuration.Configuration getConfiguration()
-
getConfigurationForCountry
public org.openstreetmap.atlas.utilities.configuration.Configuration getConfigurationForCountry(java.lang.String country)
Get configuration for a specific country, overriding for country specific overrides and group specific overrides- Parameters:
country- country string- Returns:
Configuration
-
loadChecks
public <T extends Check> java.util.Set<T> loadChecks(java.util.function.Predicate<java.lang.Class> isEnabled)
-
loadChecks
public <T extends Check> java.util.Set<T> loadChecks(org.openstreetmap.atlas.utilities.configuration.Configuration configuration)
-
loadChecks
public <T extends Check> java.util.Set<T> loadChecks(java.util.function.Predicate<java.lang.Class> isEnabled, org.openstreetmap.atlas.utilities.configuration.Configuration configuration)
Loads checks that are enabled by some other means, defined byisEnabled- Type Parameters:
T- check type- Parameters:
isEnabled-Predicateused to determine if a check is enabledconfiguration-Configurationused to loadChecksCheckResourceLoader- Returns:
- a
Setof checks
-
loadChecks
public <T extends Check> java.util.Set<T> loadChecks()
Loads checks that are enabled by configuration- Type Parameters:
T- check type- Returns:
- a
Setof checks
-
loadChecksForCountry
public <T extends Check> java.util.Set<T> loadChecksForCountry(java.lang.String country)
-
-