public static String getPropertyValue(String key, String defaultValue, boolean evaluateVariables) { return getConfigProvider().getConfig().resolve(key) .withDefault(defaultValue) .evaluateVariables(evaluateVariables) .withCurrentProjectStage(false) .getValue(); }
/** * Add a {@link ConfigFilter} to the ConfigResolver. This will only affect the current WebApp (or more precisely the * current ClassLoader and it's children). * * @param configFilter */ public static void addConfigFilter(ConfigFilter configFilter) { getConfigProvider().getConfig().addConfigFilter(configFilter); }
/** * Filter the configured value. * This can e.g. be used for decryption. * @return the filtered value */ public static String filterConfigValue(String key, String value) { return getConfigProvider().getConfig().filterConfigValue(key, value, false); }
public static Properties getTestContainerConfig() { String cdiTestRunnerConfig = ConfigResolver.getProjectStageAwarePropertyValue( CUSTOM_TEST_CONTAINER_CONFIG_FILE_KEY, DEFAULT_TEST_CONTAINER_CONFIG_FILE_NAME); return PropertyLoader.getProperties(cdiTestRunnerConfig); }
/** * Resolves the value configured for the given key. * * @param key the property key * * @return the configured property value from the {@link ConfigSource} with the highest ordinal or null if there is * no configured value for it */ public static String getPropertyValue(String key) { return getConfigProvider().getConfig().resolve(key) .evaluateVariables(true) .withCurrentProjectStage(false) .getValue(); }
public static ConfigSource[] getConfigSources() { return getConfigProvider().getConfig().getConfigSources(); }
/** * The entry point to the builder-based optionally typed configuration resolution mechanism. * * String is the default type for configuration entries and is not considered a 'type' by this resolver. Therefore * an UntypedResolver is returned by this method. To convert the configuration value to another type, call * {@link UntypedResolver#as(Class)}. * * @param name The property key to resolve * @return A builder for configuration resolution. */ public static UntypedResolver<String> resolve(String name) { return getConfigProvider().getConfig().resolve(name); }
/** * This method can be used for programmatically adding {@link ConfigSource}s. * It is not needed for normal 'usage' by end users, but only for Extension Developers! * * @param configSourcesToAdd the ConfigSources to add */ public static synchronized void addConfigSources(List<ConfigSource> configSourcesToAdd) { getConfigProvider().getConfig().addConfigSources(configSourcesToAdd); }
/** * @return the {@link ConfigFilter}s for the current application. */ public static List<ConfigFilter> getConfigFilters() { return getConfigProvider().getConfig().getConfigFilters(); }
public static Config getConfig(ClassLoader cl) { return getConfigProvider().getConfig(cl); }
public static String getPropertyValue(String key, String defaultValue, boolean evaluateVariables) { return getConfigProvider().getConfig().resolve(key) .withDefault(defaultValue) .evaluateVariables(evaluateVariables) .withCurrentProjectStage(false) .getValue(); }
/** * Filter the configured value for logging. * This can e.g. be used for displaying ***** instead of a real password. * @return the filtered value */ public static String filterConfigValueForLog(String key, String value) { return getConfigProvider().getConfig().filterConfigValue(key, value, true); }
public static ConfigSource[] getConfigSources() { return getConfigProvider().getConfig().getConfigSources(); }
/** * The entry point to the builder-based optionally typed configuration resolution mechanism. * * String is the default type for configuration entries and is not considered a 'type' by this resolver. Therefore * an UntypedResolver is returned by this method. To convert the configuration value to another type, call * {@link UntypedResolver#as(Class)}. * * @param name The property key to resolve * @return A builder for configuration resolution. */ public static UntypedResolver<String> resolve(String name) { return getConfigProvider().getConfig().resolve(name); }
/** * Add a {@link ConfigFilter} to the ConfigResolver. This will only affect the current WebApp (or more precisely the * current ClassLoader and it's children). * * @param configFilter */ public static void addConfigFilter(ConfigFilter configFilter) { getConfigProvider().getConfig().addConfigFilter(configFilter); }
/** * This method can be used for programmatically adding {@link ConfigSource}s. * It is not needed for normal 'usage' by end users, but only for Extension Developers! * * @param configSourcesToAdd the ConfigSources to add */ public static synchronized void addConfigSources(List<ConfigSource> configSourcesToAdd) { getConfigProvider().getConfig().addConfigSources(configSourcesToAdd); }
/** * @return the {@link ConfigFilter}s for the current application. */ public static List<ConfigFilter> getConfigFilters() { return getConfigProvider().getConfig().getConfigFilters(); }
public static Config getConfig(ClassLoader cl) { return getConfigProvider().getConfig(cl); }
/** * Filter the configured value. * This can e.g. be used for decryption. * @return the filtered value */ public static String filterConfigValue(String key, String value) { return getConfigProvider().getConfig().filterConfigValue(key, value, false); }
/** * Filter the configured value for logging. * This can e.g. be used for displaying ***** instead of a real password. * @return the filtered value */ public static String filterConfigValueForLog(String key, String value) { return getConfigProvider().getConfig().filterConfigValue(key, value, true); }