|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.core.env.AbstractPropertyResolver
public abstract class AbstractPropertyResolver
Abstract base class for resolving properties against any underlying source.
| Field Summary | |
|---|---|
protected ConversionService |
conversionService
|
protected Log |
logger
|
| Constructor Summary | |
|---|---|
AbstractPropertyResolver()
|
|
| Method Summary | ||
|---|---|---|
ConversionService |
getConversionService()
|
|
String |
getRequiredProperty(String key)
Return the property value associated with the given key, converted to the given targetType (never null). |
|
|
getRequiredProperty(String key,
Class<T> valueType)
Return the property value associated with the given key, converted to the given targetType (never null). |
|
String |
resolvePlaceholders(String text)
Resolve ${...} placeholders in the given text, replacing them with corresponding property values as resolved by PropertyResolver.getProperty(java.lang.String). |
|
String |
resolveRequiredPlaceholders(String text)
Resolve ${...} placeholders in the given text, replacing them with corresponding property values as resolved by PropertyResolver.getProperty(java.lang.String). |
|
void |
setConversionService(ConversionService conversionService)
Set the ConversionService to be used when performing type
conversions on properties. |
|
void |
setPlaceholderPrefix(String placeholderPrefix)
|
|
void |
setPlaceholderSuffix(String placeholderSuffix)
|
|
void |
setValueSeparator(String valueSeparator)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.core.env.PropertyResolver |
|---|
containsProperty, getProperty, getProperty |
| Field Detail |
|---|
protected final Log logger
protected ConversionService conversionService
| Constructor Detail |
|---|
public AbstractPropertyResolver()
| Method Detail |
|---|
public ConversionService getConversionService()
getConversionService in interface ConfigurablePropertyResolverConversionService used when performing type
conversions on properties.PropertyResolver.getProperty(String, Class)public void setConversionService(ConversionService conversionService)
ConfigurablePropertyResolverConversionService to be used when performing type
conversions on properties.
setConversionService in interface ConfigurablePropertyResolverPropertyResolver.getProperty(String, Class)
public String getRequiredProperty(String key)
throws IllegalStateException
PropertyResolvernull).
getRequiredProperty in interface PropertyResolverIllegalStateException - if the key cannot be resolvedPropertyResolver.getRequiredProperty(String, Class)
public <T> T getRequiredProperty(String key,
Class<T> valueType)
throws IllegalStateException
PropertyResolvernull).
getRequiredProperty in interface PropertyResolverIllegalStateException - if the given key cannot be resolvedpublic void setPlaceholderPrefix(String placeholderPrefix)
setPlaceholderPrefix in interface ConfigurablePropertyResolverpublic void setPlaceholderSuffix(String placeholderSuffix)
setPlaceholderSuffix in interface ConfigurablePropertyResolverpublic void setValueSeparator(String valueSeparator)
setValueSeparator in interface ConfigurablePropertyResolverpublic String resolvePlaceholders(String text)
PropertyResolverPropertyResolver.getProperty(java.lang.String). Unresolvable placeholders with
no default value are ignored and passed through unchanged.
resolvePlaceholders in interface PropertyResolvertext - the String to resolve
null)PropertyResolver.resolveRequiredPlaceholders(java.lang.String),
SystemPropertyUtils.resolvePlaceholders(String)
public String resolveRequiredPlaceholders(String text)
throws IllegalArgumentException
PropertyResolverPropertyResolver.getProperty(java.lang.String). Unresolvable placeholders with
no default value will cause an IllegalArgumentException to be thrown.
resolveRequiredPlaceholders in interface PropertyResolvernull)
IllegalArgumentException - if given text is nullSystemPropertyUtils.resolvePlaceholders(String, boolean)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||