类org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver源码实例Demo

下面列出了怎么用org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver的API类实例代码及写法,或者点击链接到github查看源代码。

public StaticStringValueResolver(final Map<String, String> values) {
	this.helper = new PropertyPlaceholderHelper("${", "}", ":", false);
	this.resolver = new PlaceholderResolver() {
		@Override
		public String resolvePlaceholder(String placeholderName) {
			return values.get(placeholderName);
		}
	};
}
 
@SuppressWarnings("unchecked")
private PlaceholderResolver initVarResolver(MessageHeaders headers) {
	String name = DestinationVariableMethodArgumentResolver.DESTINATION_TEMPLATE_VARIABLES_HEADER;
	Map<String, String> vars = (Map<String, String>) headers.get(name);
	return new DestinationVariablePlaceholderResolver(vars);
}
 
源代码3 项目: lams   文件: PropertyPlaceholderConfigurer.java
/**
 * Parse the given String value for placeholder resolution.
 * @param strVal the String value to parse
 * @param props the Properties to resolve placeholders against
 * @param visitedPlaceholders the placeholders that have already been visited
 * during the current resolution attempt (ignored in this version of the code)
 * @deprecated as of Spring 3.0, in favor of using {@link #resolvePlaceholder}
 * with {@link org.springframework.util.PropertyPlaceholderHelper}.
 * Only retained for compatibility with Spring 2.5 extensions.
 */
@Deprecated
protected String parseStringValue(String strVal, Properties props, Set<?> visitedPlaceholders) {
	PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper(
			placeholderPrefix, placeholderSuffix, valueSeparator, ignoreUnresolvablePlaceholders);
	PlaceholderResolver resolver = new PropertyPlaceholderConfigurerResolver(props);
	return helper.replacePlaceholders(strVal, resolver);
}
 
/**
 * Parse the given String value for placeholder resolution.
 * @param strVal the String value to parse
 * @param props the Properties to resolve placeholders against
 * @param visitedPlaceholders the placeholders that have already been visited
 * during the current resolution attempt (ignored in this version of the code)
 * @deprecated as of Spring 3.0, in favor of using {@link #resolvePlaceholder}
 * with {@link PropertyPlaceholderHelper}.
 * Only retained for compatibility with Spring 2.5 extensions.
 */
@Deprecated
protected String parseStringValue(String strVal, Properties props, Set<?> visitedPlaceholders) {
	PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper(
			placeholderPrefix, placeholderSuffix, valueSeparator, ignoreUnresolvablePlaceholders);
	PlaceholderResolver resolver = new PropertyPlaceholderConfigurerResolver(props);
	return helper.replacePlaceholders(strVal, resolver);
}
 
/**
 * Parse the given String value for placeholder resolution.
 * @param strVal the String value to parse
 * @param props the Properties to resolve placeholders against
 * @param visitedPlaceholders the placeholders that have already been visited
 * during the current resolution attempt (ignored in this version of the code)
 * @deprecated as of Spring 3.0, in favor of using {@link #resolvePlaceholder}
 * with {@link org.springframework.util.PropertyPlaceholderHelper}.
 * Only retained for compatibility with Spring 2.5 extensions.
 */
@Deprecated
protected String parseStringValue(String strVal, Properties props, Set<?> visitedPlaceholders) {
	PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper(
			placeholderPrefix, placeholderSuffix, valueSeparator, ignoreUnresolvablePlaceholders);
	PlaceholderResolver resolver = new PropertyPlaceholderConfigurerResolver(props);
	return helper.replacePlaceholders(strVal, resolver);
}
 
 类所在包
 同包方法