Java Code Examples for org.springframework.util.StringValueResolver

The following examples show how to use org.springframework.util.StringValueResolver. These examples are extracted from open source projects. 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
/**
 * Visit each bean definition in the given bean factory and attempt to replace ${...} property
 * placeholders with values from the given properties.
 */
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess,
		final ConfigurablePropertyResolver propertyResolver) throws BeansException {

	propertyResolver.setPlaceholderPrefix(this.placeholderPrefix);
	propertyResolver.setPlaceholderSuffix(this.placeholderSuffix);
	propertyResolver.setValueSeparator(this.valueSeparator);

	StringValueResolver valueResolver = strVal -> {
		String resolved = (this.ignoreUnresolvablePlaceholders ?
				propertyResolver.resolvePlaceholders(strVal) :
				propertyResolver.resolveRequiredPlaceholders(strVal));
		if (this.trimValues) {
			resolved = resolved.trim();
		}
		return (resolved.equals(this.nullValue) ? null : resolved);
	};

	doProcessProperties(beanFactoryToProcess, valueResolver);
}
 
Example 2
Source Project: spring-analysis-note   Source File: NumberFormattingTests.java    License: MIT License 6 votes vote down vote up
@Before
public void setUp() {
	DefaultConversionService.addDefaultConverters(conversionService);
	conversionService.setEmbeddedValueResolver(new StringValueResolver() {
		@Override
		public String resolveStringValue(String strVal) {
			if ("${pattern}".equals(strVal)) {
				return "#,##.00";
			}
			else {
				return strVal;
			}
		}
	});
	conversionService.addFormatterForFieldType(Number.class, new NumberStyleFormatter());
	conversionService.addFormatterForFieldAnnotation(new NumberFormatAnnotationFormatterFactory());
	LocaleContextHolder.setLocale(Locale.US);
	binder = new DataBinder(new TestBean());
	binder.setConversionService(conversionService);
}
 
Example 3
Source Project: spring-analysis-note   Source File: CarBeanFactoryPostProcessor.java    License: MIT License 6 votes vote down vote up
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
	// 从 beanFactory 中获取 bean 名字列表
	String[] beanNames = beanFactory.getBeanDefinitionNames();
	for (String beanName : beanNames) {
		BeanDefinition definition = beanFactory.getBeanDefinition(beanName);
		StringValueResolver valueResolver = strVal -> {
			if (isObscene(strVal)) return "*****";
			return strVal;
		};
		BeanDefinitionVisitor visitor = new BeanDefinitionVisitor(valueResolver);
		// 这一步才是真正处理 bean 的配置信息
		visitor.visitBeanDefinition(definition);
	}

}
 
Example 4
@Test
public void resolveEmbeddedValue() throws Exception {
	DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
	StringValueResolver r1 = mock(StringValueResolver.class);
	StringValueResolver r2 = mock(StringValueResolver.class);
	StringValueResolver r3 = mock(StringValueResolver.class);
	bf.addEmbeddedValueResolver(r1);
	bf.addEmbeddedValueResolver(r2);
	bf.addEmbeddedValueResolver(r3);
	given(r1.resolveStringValue("A")).willReturn("B");
	given(r2.resolveStringValue("B")).willReturn(null);
	given(r3.resolveStringValue(isNull(String.class))).willThrow(new IllegalArgumentException());

	bf.resolveEmbeddedValue("A");

	verify(r1).resolveStringValue("A");
	verify(r2).resolveStringValue("B");
	verify(r3, never()).resolveStringValue(isNull(String.class));
}
 
Example 5
/**
 * Visit each bean definition in the given bean factory and attempt to replace ${...} property
 * placeholders with values from the given properties.
 */
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess,
		final ConfigurablePropertyResolver propertyResolver) throws BeansException {

	propertyResolver.setPlaceholderPrefix(this.placeholderPrefix);
	propertyResolver.setPlaceholderSuffix(this.placeholderSuffix);
	propertyResolver.setValueSeparator(this.valueSeparator);

	StringValueResolver valueResolver = strVal -> {
		String resolved = (this.ignoreUnresolvablePlaceholders ?
				propertyResolver.resolvePlaceholders(strVal) :
				propertyResolver.resolveRequiredPlaceholders(strVal));
		if (this.trimValues) {
			resolved = resolved.trim();
		}
		return (resolved.equals(this.nullValue) ? null : resolved);
	};

	doProcessProperties(beanFactoryToProcess, valueResolver);
}
 
Example 6
protected void doProcessProperties(ConfigurableListableBeanFactory beanFactoryToProcess,
		StringValueResolver valueResolver) {

	BeanDefinitionVisitor visitor = new BeanDefinitionVisitor(valueResolver);

	String[] beanNames = beanFactoryToProcess.getBeanDefinitionNames();
	for (String curName : beanNames) {
		// Check that we're not parsing our own bean definition,
		// to avoid failing on unresolvable placeholders in properties file locations.
		if (!(curName.equals(this.beanName) && beanFactoryToProcess.equals(this.beanFactory))) {
			BeanDefinition bd = beanFactoryToProcess.getBeanDefinition(curName);
			try {
				visitor.visitBeanDefinition(bd);
			}
			catch (Exception ex) {
				throw new BeanDefinitionStoreException(bd.getResourceDescription(), curName, ex.getMessage(), ex);
			}
		}
	}

	// New in Spring 2.5: resolve placeholders in alias target names and aliases as well.
	beanFactoryToProcess.resolveAliases(valueResolver);

	// New in Spring 3.0: resolve placeholders in embedded values such as annotation attributes.
	beanFactoryToProcess.addEmbeddedValueResolver(valueResolver);
}
 
Example 7
Source Project: java-technology-stack   Source File: NumberFormattingTests.java    License: MIT License 6 votes vote down vote up
@Before
public void setUp() {
	DefaultConversionService.addDefaultConverters(conversionService);
	conversionService.setEmbeddedValueResolver(new StringValueResolver() {
		@Override
		public String resolveStringValue(String strVal) {
			if ("${pattern}".equals(strVal)) {
				return "#,##.00";
			}
			else {
				return strVal;
			}
		}
	});
	conversionService.addFormatterForFieldType(Number.class, new NumberStyleFormatter());
	conversionService.addFormatterForFieldAnnotation(new NumberFormatAnnotationFormatterFactory());
	LocaleContextHolder.setLocale(Locale.US);
	binder = new DataBinder(new TestBean());
	binder.setConversionService(conversionService);
}
 
Example 8
protected void doProcessProperties(ConfigurableListableBeanFactory beanFactoryToProcess,
		StringValueResolver valueResolver) {

	BeanDefinitionVisitor visitor = new BeanDefinitionVisitor(valueResolver);

	String[] beanNames = beanFactoryToProcess.getBeanDefinitionNames();
	for (String curName : beanNames) {
		// Check that we're not parsing our own bean definition,
		// to avoid failing on unresolvable placeholders in properties file locations.
		if (!(curName.equals(this.beanName) && beanFactoryToProcess.equals(this.beanFactory))) {
			BeanDefinition bd = beanFactoryToProcess.getBeanDefinition(curName);
			try {
				visitor.visitBeanDefinition(bd);
			}
			catch (Exception ex) {
				throw new BeanDefinitionStoreException(bd.getResourceDescription(), curName, ex.getMessage(), ex);
			}
		}
	}

	// New in Spring 2.5: resolve placeholders in alias target names and aliases as well.
	beanFactoryToProcess.resolveAliases(valueResolver);

	// New in Spring 3.0: resolve placeholders in embedded values such as annotation attributes.
	beanFactoryToProcess.addEmbeddedValueResolver(valueResolver);
}
 
Example 9
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess,
		final ConfigurablePropertyResolver propertyResolver) throws BeansException {

	propertyResolver.setPlaceholderPrefix(this.placeholderPrefix);
	propertyResolver.setPlaceholderSuffix(this.placeholderSuffix);
	propertyResolver.setValueSeparator(this.valueSeparator);

	StringValueResolver valueResolver = new StringValueResolver() {
		@Override
		public String resolveStringValue(String strVal) {
			String resolved = ignoreUnresolvablePlaceholders ? propertyResolver.resolvePlaceholders(strVal)
					: propertyResolver.resolveRequiredPlaceholders(strVal);
			return (resolved.equals(nullValue) ? null : resolved);
		}
	};

	doProcessProperties(beanFactoryToProcess, valueResolver);
}
 
Example 10
@Before
public void setUp() {
	DefaultConversionService.addDefaultConverters(conversionService);
	conversionService.setEmbeddedValueResolver(new StringValueResolver() {
		@Override
		public String resolveStringValue(String strVal) {
			if ("${pattern}".equals(strVal)) {
				return "#,##.00";
			}
			else {
				return strVal;
			}
		}
	});
	conversionService.addFormatterForFieldType(Number.class, new NumberStyleFormatter());
	conversionService.addFormatterForFieldAnnotation(new NumberFormatAnnotationFormatterFactory());
	LocaleContextHolder.setLocale(Locale.US);
	binder = new DataBinder(new TestBean());
	binder.setConversionService(conversionService);
}
 
Example 11
Source Project: lams   Source File: AnnotationBeanUtils.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy the properties of the supplied {@link Annotation} to the supplied target bean.
 * Any properties defined in {@code excludedProperties} will not be copied.
 * <p>A specified value resolver may resolve placeholders in property values, for example.
 * @param ann the annotation to copy from
 * @param bean the bean instance to copy to
 * @param valueResolver a resolve to post-process String property values (may be {@code null})
 * @param excludedProperties the names of excluded properties, if any
 * @see org.springframework.beans.BeanWrapper
 */
public static void copyPropertiesToBean(Annotation ann, Object bean, StringValueResolver valueResolver, String... excludedProperties) {
	Set<String> excluded = new HashSet<String>(Arrays.asList(excludedProperties));
	Method[] annotationProperties = ann.annotationType().getDeclaredMethods();
	BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(bean);
	for (Method annotationProperty : annotationProperties) {
		String propertyName = annotationProperty.getName();
		if (!excluded.contains(propertyName) && bw.isWritableProperty(propertyName)) {
			Object value = ReflectionUtils.invokeMethod(annotationProperty, ann);
			if (valueResolver != null && value instanceof String) {
				value = valueResolver.resolveStringValue((String) value);
			}
			bw.setPropertyValue(propertyName, value);
		}
	}
}
 
Example 12
protected void doProcessProperties(ConfigurableListableBeanFactory beanFactoryToProcess,
		StringValueResolver valueResolver) {

	BeanDefinitionVisitor visitor = new BeanDefinitionVisitor(valueResolver);

	String[] beanNames = beanFactoryToProcess.getBeanDefinitionNames();
	for (String curName : beanNames) {
		// Check that we're not parsing our own bean definition,
		// to avoid failing on unresolvable placeholders in properties file locations.
		if (!(curName.equals(this.beanName) && beanFactoryToProcess.equals(this.beanFactory))) {
			BeanDefinition bd = beanFactoryToProcess.getBeanDefinition(curName);
			try {
				visitor.visitBeanDefinition(bd);
			}
			catch (Exception ex) {
				throw new BeanDefinitionStoreException(bd.getResourceDescription(), curName, ex.getMessage(), ex);
			}
		}
	}

	// New in Spring 2.5: resolve placeholders in alias target names and aliases as well.
	beanFactoryToProcess.resolveAliases(valueResolver);

	// New in Spring 3.0: resolve placeholders in embedded values such as annotation attributes.
	beanFactoryToProcess.addEmbeddedValueResolver(valueResolver);
}
 
Example 13
/**
 * Create a new {@code DefaultFormattingConversionService} with the set of
 * {@linkplain DefaultConversionService#addDefaultConverters default converters} and,
 * based on the value of {@code registerDefaultFormatters}, the set of
 * {@linkplain #addDefaultFormatters default formatters}.
 * @param embeddedValueResolver delegated to {@link #setEmbeddedValueResolver(StringValueResolver)}
 * prior to calling {@link #addDefaultFormatters}.
 * @param registerDefaultFormatters whether to register default formatters
 */
public DefaultFormattingConversionService(
		@Nullable StringValueResolver embeddedValueResolver, boolean registerDefaultFormatters) {

	if (embeddedValueResolver != null) {
		setEmbeddedValueResolver(embeddedValueResolver);
	}
	DefaultConversionService.addDefaultConverters(this);
	if (registerDefaultFormatters) {
		addDefaultFormatters(this);
	}
}
 
Example 14
/**
 * Visit each bean definition in the given bean factory and attempt to replace ${...} property
 * placeholders with values from the given properties.
 */
@Override
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props)
		throws BeansException {

	StringValueResolver valueResolver = new PlaceholderResolvingStringValueResolver(props);
	doProcessProperties(beanFactoryToProcess, valueResolver);
}
 
Example 15
Source Project: ShedLock   Source File: SpringLockConfigurationExtractor.java    License: Apache License 2.0 5 votes vote down vote up
public SpringLockConfigurationExtractor(
    @NonNull Duration defaultLockAtMostFor,
    @NonNull Duration defaultLockAtLeastFor,
    @Nullable StringValueResolver embeddedValueResolver,
    @NonNull Converter<String, Duration> durationConverter
) {
    this.defaultLockAtMostFor = requireNonNull(defaultLockAtMostFor);
    this.defaultLockAtLeastFor = requireNonNull(defaultLockAtLeastFor);
    this.durationConverter = requireNonNull(durationConverter);
    this.embeddedValueResolver = embeddedValueResolver;
}
 
Example 16
Source Project: blog_demos   Source File: AbstractBeanFactory.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String resolveEmbeddedValue(String value) {
	String result = value;
	for (StringValueResolver resolver : this.embeddedValueResolvers) {
		if (result == null) {
			return null;
		}
		result = resolver.resolveStringValue(result);
	}
	return result;
}
 
Example 17
Source Project: spring4-understanding   Source File: AbstractBeanFactory.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String resolveEmbeddedValue(String value) {
	String result = value;
	for (StringValueResolver resolver : this.embeddedValueResolvers) {
		if (result == null) {
			return null;
		}
		result = resolver.resolveStringValue(result);
	}
	return result;
}
 
Example 18
Source Project: java-technology-stack   Source File: SimpleAliasRegistry.java    License: MIT License 5 votes vote down vote up
/**
 * Resolve all alias target names and aliases registered in this
 * factory, applying the given StringValueResolver to them.
 * <p>The value resolver may for example resolve placeholders
 * in target bean names and even in alias names.
 * @param valueResolver the StringValueResolver to apply
 */
public void resolveAliases(StringValueResolver valueResolver) {
	Assert.notNull(valueResolver, "StringValueResolver must not be null");
	synchronized (this.aliasMap) {
		Map<String, String> aliasCopy = new HashMap<>(this.aliasMap);
		aliasCopy.forEach((alias, registeredName) -> {
			String resolvedAlias = valueResolver.resolveStringValue(alias);
			String resolvedName = valueResolver.resolveStringValue(registeredName);
			if (resolvedAlias == null || resolvedName == null || resolvedAlias.equals(resolvedName)) {
				this.aliasMap.remove(alias);
			}
			else if (!resolvedAlias.equals(alias)) {
				String existingName = this.aliasMap.get(resolvedAlias);
				if (existingName != null) {
					if (existingName.equals(resolvedName)) {
						// Pointing to existing alias - just remove placeholder
						this.aliasMap.remove(alias);
						return;
					}
					throw new IllegalStateException(
							"Cannot register resolved alias '" + resolvedAlias + "' (original: '" + alias +
							"') for name '" + resolvedName + "': It is already registered for name '" +
							registeredName + "'.");
				}
				checkForAliasCircle(resolvedName, resolvedAlias);
				this.aliasMap.remove(alias);
				this.aliasMap.put(resolvedAlias, resolvedName);
			}
			else if (!registeredName.equals(resolvedName)) {
				this.aliasMap.put(alias, resolvedName);
			}
		});
	}
}
 
Example 19
Source Project: camunda-bpm-platform   Source File: Scopifier.java    License: Apache License 2.0 5 votes vote down vote up
public Scopifier(BeanDefinitionRegistry registry, String scope, boolean proxyTargetClass, boolean scoped) {
	super(new StringValueResolver() {
		public String resolveStringValue(String value) {
			return value;
		}
	});
	this.registry = registry;
	this.proxyTargetClass = proxyTargetClass;
	this.scope = scope;
	this.scoped = scoped;
}
 
Example 20
Source Project: qconfig   Source File: QConfigPropertyAnnotationUtil.java    License: MIT License 5 votes vote down vote up
static StringValueResolver buildStringValueResolver(Map<String, Properties> filenameToPropsMap) {
    MutablePropertySources propertySources = new MutablePropertySources();
    for (Map.Entry<String, Properties> entry : filenameToPropsMap.entrySet()) {
        propertySources.addFirst(new PropertiesPropertySource(entry.getKey(), entry.getValue()));
    }
    return buildStringValueResolver(new PropertySourcesPropertyResolver(propertySources));
}
 
Example 21
Source Project: blog_demos   Source File: PropertyPlaceholderConfigurer.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Visit each bean definition in the given bean factory and attempt to replace ${...} property
 * placeholders with values from the given properties.
 */
@Override
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props)
		throws BeansException {

	StringValueResolver valueResolver = new PlaceholderResolvingStringValueResolver(props);

	this.doProcessProperties(beanFactoryToProcess, valueResolver);
}
 
Example 22
Source Project: servicecomb-java-chassis   Source File: SpringUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static StringValueResolver createStringValueResolver(Map<String, Object> map) {
  StandardEnvironment standardEnvironment = new StandardEnvironment();
  standardEnvironment.getPropertySources().addFirst(
      new MapPropertySource(UUID.randomUUID().toString(), map));

  return standardEnvironment::resolvePlaceholders;
}
 
Example 23
Source Project: spring4-understanding   Source File: SimpleAliasRegistry.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Resolve all alias target names and aliases registered in this
 * factory, applying the given StringValueResolver to them.
 * <p>The value resolver may for example resolve placeholders
 * in target bean names and even in alias names.
 * @param valueResolver the StringValueResolver to apply
 */
public void resolveAliases(StringValueResolver valueResolver) {
	Assert.notNull(valueResolver, "StringValueResolver must not be null");
	synchronized (this.aliasMap) {
		Map<String, String> aliasCopy = new HashMap<String, String>(this.aliasMap);
		for (String alias : aliasCopy.keySet()) {
			String registeredName = aliasCopy.get(alias);
			String resolvedAlias = valueResolver.resolveStringValue(alias);
			String resolvedName = valueResolver.resolveStringValue(registeredName);
			if (resolvedAlias == null || resolvedName == null || resolvedAlias.equals(resolvedName)) {
				this.aliasMap.remove(alias);
			}
			else if (!resolvedAlias.equals(alias)) {
				String existingName = this.aliasMap.get(resolvedAlias);
				if (existingName != null) {
					if (existingName.equals(resolvedName)) {
						// Pointing to existing alias - just remove placeholder
						this.aliasMap.remove(alias);
						break;
					}
					throw new IllegalStateException(
							"Cannot register resolved alias '" + resolvedAlias + "' (original: '" + alias +
							"') for name '" + resolvedName + "': It is already registered for name '" +
							registeredName + "'.");
				}
				checkForAliasCircle(resolvedName, resolvedAlias);
				this.aliasMap.remove(alias);
				this.aliasMap.put(resolvedAlias, resolvedName);
			}
			else if (!registeredName.equals(resolvedName)) {
				this.aliasMap.put(alias, resolvedName);
			}
		}
	}
}
 
Example 24
@Test(expected = MappingDeclarationException.class)
public void testMissingParameters() throws Exception {
	SpringAnnotationMethodInspector inspector = new SpringAnnotationMethodInspector();
	StringValueResolver resolver = mock(StringValueResolver.class);
	inspector.setEmbeddedValueResolver(resolver);

	Method someMethod2 = getClass().getMethod("someMethod2", String.class, int.class, String.class);
	inspector.inspect(someMethod2, new Object[] { "a", new Integer(2), "c" });
}
 
Example 25
/**
 * Finish the initialization of this context's bean factory,
 * initializing all remaining singleton beans.
 */
protected void finishBeanFactoryInitialization(ConfigurableListableBeanFactory beanFactory) {
	// Initialize conversion service for this context.
	if (beanFactory.containsBean(CONVERSION_SERVICE_BEAN_NAME) &&
			beanFactory.isTypeMatch(CONVERSION_SERVICE_BEAN_NAME, ConversionService.class)) {
		beanFactory.setConversionService(
				beanFactory.getBean(CONVERSION_SERVICE_BEAN_NAME, ConversionService.class));
	}

	// Register a default embedded value resolver if no bean post-processor
	// (such as a PropertyPlaceholderConfigurer bean) registered any before:
	// at this point, primarily for resolution in annotation attribute values.
	if (!beanFactory.hasEmbeddedValueResolver()) {
		beanFactory.addEmbeddedValueResolver(new StringValueResolver() {
			@Override
			public String resolveStringValue(String strVal) {
				return getEnvironment().resolvePlaceholders(strVal);
			}
		});
	}

	// Initialize LoadTimeWeaverAware beans early to allow for registering their transformers early.
	String[] weaverAwareNames = beanFactory.getBeanNamesForType(LoadTimeWeaverAware.class, false, false);
	for (String weaverAwareName : weaverAwareNames) {
		getBean(weaverAwareName);
	}

	// Stop using the temporary ClassLoader for type matching.
	beanFactory.setTempClassLoader(null);

	// Allow for caching all bean definition metadata, not expecting further changes.
	beanFactory.freezeConfiguration();

	// Instantiate all remaining (non-lazy-init) singletons.
	beanFactory.preInstantiateSingletons();
}
 
Example 26
Source Project: lams   Source File: SimpleAliasRegistry.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Resolve all alias target names and aliases registered in this
 * factory, applying the given StringValueResolver to them.
 * <p>The value resolver may for example resolve placeholders
 * in target bean names and even in alias names.
 * @param valueResolver the StringValueResolver to apply
 */
public void resolveAliases(StringValueResolver valueResolver) {
	Assert.notNull(valueResolver, "StringValueResolver must not be null");
	synchronized (this.aliasMap) {
		Map<String, String> aliasCopy = new HashMap<String, String>(this.aliasMap);
		for (String alias : aliasCopy.keySet()) {
			String registeredName = aliasCopy.get(alias);
			String resolvedAlias = valueResolver.resolveStringValue(alias);
			String resolvedName = valueResolver.resolveStringValue(registeredName);
			if (resolvedAlias == null || resolvedName == null || resolvedAlias.equals(resolvedName)) {
				this.aliasMap.remove(alias);
			}
			else if (!resolvedAlias.equals(alias)) {
				String existingName = this.aliasMap.get(resolvedAlias);
				if (existingName != null) {
					if (existingName.equals(resolvedName)) {
						// Pointing to existing alias - just remove placeholder
						this.aliasMap.remove(alias);
						break;
					}
					throw new IllegalStateException(
							"Cannot register resolved alias '" + resolvedAlias + "' (original: '" + alias +
							"') for name '" + resolvedName + "': It is already registered for name '" +
							registeredName + "'.");
				}
				checkForAliasCircle(resolvedName, resolvedAlias);
				this.aliasMap.remove(alias);
				this.aliasMap.put(resolvedAlias, resolvedName);
			}
			else if (!registeredName.equals(resolvedName)) {
				this.aliasMap.put(alias, resolvedName);
			}
		}
	}
}
 
Example 27
@Override
public void setEmbeddedValueResolver(StringValueResolver resolver) {
	this.valueResolver = resolver;
}
 
Example 28
@Override
public void setEmbeddedValueResolver(StringValueResolver resolver) {
	this.valueResolver = resolver;
}
 
Example 29
@Override
public void setEmbeddedValueResolver(StringValueResolver resolver) {
	this.embeddedValueResolver = resolver;
}
 
Example 30
@Override
public void setEmbeddedValueResolver(StringValueResolver resolver) {
	this.embeddedValueResolver = resolver;
}