|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConfigurablePropertyResolver
Configuration interface to be implemented by most if not all PropertyResolver
types. Provides facilities for accessing and customizing the
ConversionService
used when
converting property values from one type to another.
Method Summary | |
---|---|
ConfigurableConversionService |
getConversionService()
|
void |
setConversionService(ConfigurableConversionService conversionService)
Set the ConfigurableConversionService to be used when performing type
conversions on properties. |
void |
setPlaceholderPrefix(String placeholderPrefix)
Set the prefix that placeholders replaced by this resolver must begin with. |
void |
setPlaceholderSuffix(String placeholderSuffix)
Set the suffix that placeholders replaced by this resolver must end with. |
void |
setRequiredProperties(String... requiredProperties)
Specify which properties must be present, to be verified by validateRequiredProperties() . |
void |
setValueSeparator(String valueSeparator)
Specify the separating character between the placeholders replaced by this resolver and their associated default value, or null if no such
special character should be processed as a value separator. |
void |
validateRequiredProperties()
Validate that each of the properties specified by setRequiredProperties(java.lang.String...) is present and resolves to a
non-null value. |
Methods inherited from interface org.springframework.core.env.PropertyResolver |
---|
containsProperty, getProperty, getProperty, getProperty, getProperty, getPropertyAsClass, getRequiredProperty, getRequiredProperty, resolvePlaceholders, resolveRequiredPlaceholders |
Method Detail |
---|
ConfigurableConversionService getConversionService()
ConfigurableConversionService
used when performing type
conversions on properties.
The configurable nature of the returned conversion service allows for
the convenient addition and removal of individual Converter
instances:
ConfigurableConversionService cs = env.getConversionService(); cs.addConverter(new FooConverter());
PropertyResolver.getProperty(String, Class)
,
ConverterRegistry.addConverter(org.springframework.core.convert.converter.Converter, ?>)
void setConversionService(ConfigurableConversionService conversionService)
ConfigurableConversionService
to be used when performing type
conversions on properties.
Note: as an alternative to fully replacing the ConversionService
, consider adding or removing individual Converter
instances by drilling into getConversionService()
and calling methods
such as #addConverter
.
PropertyResolver.getProperty(String, Class)
,
getConversionService()
,
ConverterRegistry.addConverter(org.springframework.core.convert.converter.Converter, ?>)
void setPlaceholderPrefix(String placeholderPrefix)
void setPlaceholderSuffix(String placeholderSuffix)
void setValueSeparator(String valueSeparator)
null
if no such
special character should be processed as a value separator.
void setRequiredProperties(String... requiredProperties)
validateRequiredProperties()
.
void validateRequiredProperties() throws MissingRequiredPropertiesException
setRequiredProperties(java.lang.String...)
is present and resolves to a
non-null
value.
MissingRequiredPropertiesException
- if any of the required
properties are not resolvable.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |