org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver Java Examples

The following examples show how to use org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StandaloneMockMvcBuilder.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
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);
		}
	};
}
 
Example #2
Source File: SendToMethodReturnValueHandler.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@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);
}
 
Example #3
Source File: PropertyPlaceholderConfigurer.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
}
 
Example #4
Source File: PropertyPlaceholderConfigurer.java    From blog_demos with Apache License 2.0 3 votes vote down vote up
/**
 * 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);
}
 
Example #5
Source File: PropertyPlaceholderConfigurer.java    From spring4-understanding with Apache License 2.0 3 votes vote down vote up
/**
 * 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);
}