/** * Checks whether the string substitution functionality should be enabled. * * @param bootstrapConfig used to provide basic, initial startup configuration * @return true if the configuration substitution should be performed */ private static boolean getIsSubstitutorEnabled(final BootstrapConfiguration bootstrapConfig) { final String ENABLE_SUBSTITUTOR_CONFIG_KEY = "CAF_CONFIG_ENABLE_SUBSTITUTOR"; final boolean ENABLE_SUBSTITUTOR_CONFIG_DEFAULT = true; // Return the default if the setting is not configured if (!bootstrapConfig.isConfigurationPresent(ENABLE_SUBSTITUTOR_CONFIG_KEY)) { return ENABLE_SUBSTITUTOR_CONFIG_DEFAULT; } // Return the configured setting. // The ConfigurationException should never happen since isConfigurationPresent() has already been called. try { return bootstrapConfig.getConfigurationBoolean(ENABLE_SUBSTITUTOR_CONFIG_KEY); } catch (final ConfigurationException ex) { throw new RuntimeException(ex); } }