|
|
|
@ -295,7 +295,8 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* {@inheritDoc} |
|
|
|
* Specify the set of profiles to be made active by default if no other profiles |
|
|
|
|
|
|
|
* are explicitly made active through {@link #setActiveProfiles}. |
|
|
|
* <p>Calling this method removes overrides any reserved default profiles |
|
|
|
* <p>Calling this method removes overrides any reserved default profiles |
|
|
|
* that may have been added during construction of the environment. |
|
|
|
* that may have been added during construction of the environment. |
|
|
|
* @see #AbstractEnvironment() |
|
|
|
* @see #AbstractEnvironment() |
|
|
|
@ -456,93 +457,98 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { |
|
|
|
//---------------------------------------------------------------------
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean containsProperty(String key) { |
|
|
|
public ConfigurableConversionService getConversionService() { |
|
|
|
return this.propertyResolver.containsProperty(key); |
|
|
|
return this.propertyResolver.getConversionService(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String getProperty(String key) { |
|
|
|
public void setConversionService(ConfigurableConversionService conversionService) { |
|
|
|
return this.propertyResolver.getProperty(key); |
|
|
|
this.propertyResolver.setConversionService(conversionService); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String getProperty(String key, String defaultValue) { |
|
|
|
public void setPlaceholderPrefix(String placeholderPrefix) { |
|
|
|
return this.propertyResolver.getProperty(key, defaultValue); |
|
|
|
this.propertyResolver.setPlaceholderPrefix(placeholderPrefix); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public <T> T getProperty(String key, Class<T> targetType) { |
|
|
|
public void setPlaceholderSuffix(String placeholderSuffix) { |
|
|
|
return this.propertyResolver.getProperty(key, targetType); |
|
|
|
this.propertyResolver.setPlaceholderSuffix(placeholderSuffix); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public <T> T getProperty(String key, Class<T> targetType, T defaultValue) { |
|
|
|
public void setValueSeparator(String valueSeparator) { |
|
|
|
return this.propertyResolver.getProperty(key, targetType, defaultValue); |
|
|
|
this.propertyResolver.setValueSeparator(valueSeparator); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public <T> Class<T> getPropertyAsClass(String key, Class<T> targetType) { |
|
|
|
public void setIgnoreUnresolvableNestedPlaceholders(boolean ignoreUnresolvableNestedPlaceholders) { |
|
|
|
return this.propertyResolver.getPropertyAsClass(key, targetType); |
|
|
|
this.propertyResolver.setIgnoreUnresolvableNestedPlaceholders(ignoreUnresolvableNestedPlaceholders); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String getRequiredProperty(String key) throws IllegalStateException { |
|
|
|
public void setRequiredProperties(String... requiredProperties) { |
|
|
|
return this.propertyResolver.getRequiredProperty(key); |
|
|
|
this.propertyResolver.setRequiredProperties(requiredProperties); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public <T> T getRequiredProperty(String key, Class<T> targetType) throws IllegalStateException { |
|
|
|
public void validateRequiredProperties() throws MissingRequiredPropertiesException { |
|
|
|
return this.propertyResolver.getRequiredProperty(key, targetType); |
|
|
|
this.propertyResolver.validateRequiredProperties(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
|
|
|
// Implementation of PropertyResolver interface
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setRequiredProperties(String... requiredProperties) { |
|
|
|
public boolean containsProperty(String key) { |
|
|
|
this.propertyResolver.setRequiredProperties(requiredProperties); |
|
|
|
return this.propertyResolver.containsProperty(key); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void validateRequiredProperties() throws MissingRequiredPropertiesException { |
|
|
|
public String getProperty(String key) { |
|
|
|
this.propertyResolver.validateRequiredProperties(); |
|
|
|
return this.propertyResolver.getProperty(key); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String resolvePlaceholders(String text) { |
|
|
|
public String getProperty(String key, String defaultValue) { |
|
|
|
return this.propertyResolver.resolvePlaceholders(text); |
|
|
|
return this.propertyResolver.getProperty(key, defaultValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String resolveRequiredPlaceholders(String text) throws IllegalArgumentException { |
|
|
|
public <T> T getProperty(String key, Class<T> targetType) { |
|
|
|
return this.propertyResolver.resolveRequiredPlaceholders(text); |
|
|
|
return this.propertyResolver.getProperty(key, targetType); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setIgnoreUnresolvableNestedPlaceholders(boolean ignoreUnresolvableNestedPlaceholders) { |
|
|
|
public <T> T getProperty(String key, Class<T> targetType, T defaultValue) { |
|
|
|
this.propertyResolver.setIgnoreUnresolvableNestedPlaceholders(ignoreUnresolvableNestedPlaceholders); |
|
|
|
return this.propertyResolver.getProperty(key, targetType, defaultValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setConversionService(ConfigurableConversionService conversionService) { |
|
|
|
public <T> Class<T> getPropertyAsClass(String key, Class<T> targetType) { |
|
|
|
this.propertyResolver.setConversionService(conversionService); |
|
|
|
return this.propertyResolver.getPropertyAsClass(key, targetType); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public ConfigurableConversionService getConversionService() { |
|
|
|
public String getRequiredProperty(String key) throws IllegalStateException { |
|
|
|
return this.propertyResolver.getConversionService(); |
|
|
|
return this.propertyResolver.getRequiredProperty(key); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setPlaceholderPrefix(String placeholderPrefix) { |
|
|
|
public <T> T getRequiredProperty(String key, Class<T> targetType) throws IllegalStateException { |
|
|
|
this.propertyResolver.setPlaceholderPrefix(placeholderPrefix); |
|
|
|
return this.propertyResolver.getRequiredProperty(key, targetType); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setPlaceholderSuffix(String placeholderSuffix) { |
|
|
|
public String resolvePlaceholders(String text) { |
|
|
|
this.propertyResolver.setPlaceholderSuffix(placeholderSuffix); |
|
|
|
return this.propertyResolver.resolvePlaceholders(text); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValueSeparator(String valueSeparator) { |
|
|
|
public String resolveRequiredPlaceholders(String text) throws IllegalArgumentException { |
|
|
|
this.propertyResolver.setValueSeparator(valueSeparator); |
|
|
|
return this.propertyResolver.resolveRequiredPlaceholders(text); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|