当前位置: 首页>>代码示例>>Java>>正文


Java PlaceholderConfigurerSupport类代码示例

本文整理汇总了Java中org.springframework.beans.factory.config.PlaceholderConfigurerSupport的典型用法代码示例。如果您正苦于以下问题:Java PlaceholderConfigurerSupport类的具体用法?Java PlaceholderConfigurerSupport怎么用?Java PlaceholderConfigurerSupport使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PlaceholderConfigurerSupport类属于org.springframework.beans.factory.config包,在下文中一共展示了PlaceholderConfigurerSupport类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: propertyPlaceholder

import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; //导入依赖的package包/类
@Test
public void propertyPlaceholder() throws Exception {
	ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
			"contextNamespaceHandlerTests-replace.xml", getClass());
	Map<String, PlaceholderConfigurerSupport> beans = applicationContext
			.getBeansOfType(PlaceholderConfigurerSupport.class);
	assertFalse("No PropertyPlaceholderConfigurer found", beans.isEmpty());
	assertEquals("bar", applicationContext.getBean("string"));
	assertEquals("null", applicationContext.getBean("nullString"));
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:11,代码来源:ContextNamespaceHandlerTests.java

示例2: propertyPlaceholderEnvironmentProperties

import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; //导入依赖的package包/类
@Test
public void propertyPlaceholderEnvironmentProperties() throws Exception {
	MockEnvironment env = new MockEnvironment().withProperty("foo", "spam");
	GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext();
	applicationContext.setEnvironment(env);
	applicationContext.load(new ClassPathResource("contextNamespaceHandlerTests-simple.xml", getClass()));
	applicationContext.refresh();
	Map<String, PlaceholderConfigurerSupport> beans = applicationContext
			.getBeansOfType(PlaceholderConfigurerSupport.class);
	assertFalse("No PropertyPlaceholderConfigurer found", beans.isEmpty());
	assertEquals("spam", applicationContext.getBean("string"));
	assertEquals("none", applicationContext.getBean("fallback"));
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:14,代码来源:ContextNamespaceHandlerTests.java

示例3: propertyPlaceholderIgnored

import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; //导入依赖的package包/类
@Test
public void propertyPlaceholderIgnored() throws Exception {
	ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
			"contextNamespaceHandlerTests-replace-ignore.xml", getClass());
	Map<String, PlaceholderConfigurerSupport> beans = applicationContext
			.getBeansOfType(PlaceholderConfigurerSupport.class);
	assertFalse("No PropertyPlaceholderConfigurer found", beans.isEmpty());
	assertEquals("${bar}", applicationContext.getBean("string"));
	assertEquals("null", applicationContext.getBean("nullString"));
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:11,代码来源:ContextNamespaceHandlerTests.java

示例4: resolvePlaceholders

import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; //导入依赖的package包/类
public String resolvePlaceholders(String str, boolean asPropName) {
    if (asPropName) {
        String strResolving = PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_PREFIX + str + PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_SUFFIX,
            strResolved = this.beanFactory.resolveEmbeddedValue(strResolving);

        if (!strResolved.equals(strResolving)) {
            str = strResolved;
        }
    } else {
        str = this.beanFactory.resolveEmbeddedValue(str);
    }

    return Objects.toString(this.beanExprResolver.evaluate(str, this.beanExprContext), null);
}
 
开发者ID:esacinc,项目名称:sdcct,代码行数:15,代码来源:EmbeddedPlaceholderResolver.java

示例5: propertyPlaceholder

import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; //导入依赖的package包/类
@Test
public void propertyPlaceholder() throws Exception {
	ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
			"contextNamespaceHandlerTests-replace.xml", getClass());
	Map<String, PlaceholderConfigurerSupport> beans = applicationContext
			.getBeansOfType(PlaceholderConfigurerSupport.class);
	assertFalse("No PropertyPlaceholderConfigurer found", beans.isEmpty());
	String s = (String) applicationContext.getBean("string");
	assertEquals("No properties replaced", "bar", s);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:11,代码来源:ContextNamespaceHandlerTests.java

示例6: propertyPlaceholderEnvironmentProperties

import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; //导入依赖的package包/类
@Test
public void propertyPlaceholderEnvironmentProperties() throws Exception {
	MockEnvironment env = new MockEnvironment().withProperty("foo", "spam");
	GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext();
	applicationContext.setEnvironment(env);
	applicationContext.load(new ClassPathResource("contextNamespaceHandlerTests-simple.xml", getClass()));
	applicationContext.refresh();
	Map<String, PlaceholderConfigurerSupport> beans = applicationContext
			.getBeansOfType(PlaceholderConfigurerSupport.class);
	assertFalse("No PropertyPlaceholderConfigurer found", beans.isEmpty());
	String s = (String) applicationContext.getBean("string");
	assertEquals("No properties replaced", "spam", s);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:14,代码来源:ContextNamespaceHandlerTests.java

示例7: propertyPlaceholderIgnored

import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; //导入依赖的package包/类
@Test
public void propertyPlaceholderIgnored() throws Exception {
	ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
			"contextNamespaceHandlerTests-replace-ignore.xml", getClass());
	Map<String, PlaceholderConfigurerSupport> beans = applicationContext
			.getBeansOfType(PlaceholderConfigurerSupport.class);
	assertFalse("No PropertyPlaceholderConfigurer found", beans.isEmpty());
	String s = (String) applicationContext.getBean("string");
	assertEquals("Properties replaced", "${bar}", s);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:11,代码来源:ContextNamespaceHandlerTests.java

示例8: FrameworkBeanFactory

import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; //导入依赖的package包/类
/**
 * Creates a bean factory.
 *
 * @param parentContext Parent application context, if any. When specified, any placeholder
 *            configurers found in the parent context will be registered in this bean factory.
 * @param parentBeanFactory The parent bean factory, if any.
 */
public FrameworkBeanFactory(ApplicationContext parentContext, BeanFactory parentBeanFactory) {
    super(parentBeanFactory);
    int i = 0;
    
    if (parentContext != null) {
        for (PlaceholderConfigurerSupport configurer : parentContext
                .getBeansOfType(PlaceholderConfigurerSupport.class, false, false).values()) {
            registerSingleton("_placeholderconfigurer" + ++i, configurer);
        }
    }
}
 
开发者ID:carewebframework,项目名称:carewebframework-core,代码行数:19,代码来源:FrameworkBeanFactory.java

示例9: SpringPropertyReplacer

import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; //导入依赖的package包/类
/**
 * Default constructor
 */
public SpringPropertyReplacer() {
	phHelper = new PropertyPlaceholderHelper(
			PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_PREFIX,
			PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_SUFFIX,
			PlaceholderConfigurerSupport.DEFAULT_VALUE_SEPARATOR, true);
}
 
开发者ID:pmeisen,项目名称:gen-sbconfigurator,代码行数:10,代码来源:SpringPropertyReplacer.java

示例10: matches

import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; //导入依赖的package包/类
@Override
public boolean matches(
        final ConditionContext context, final AnnotatedTypeMetadata metadata
) {
    return context.getBeanFactory().getBeansOfType(PlaceholderConfigurerSupport.class).isEmpty();
}
 
开发者ID:lancomsystems,项目名称:stomp,代码行数:7,代码来源:StompSupportConfiguration.java

示例11: placeholderConfigurer

import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; //导入依赖的package包/类
@Bean
public static PlaceholderConfigurerSupport placeholderConfigurer() {
	return new ConfigurationPropertySourcesPlaceholderConfigurer(StaticConfigurationSupplier.getConfiguration());
}
 
开发者ID:xiangxik,项目名称:java-platform,代码行数:5,代码来源:ServletConfiguration.java

示例12: initializeHelper

import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; //导入依赖的package包/类
protected void initializeHelper() {
	helper = new PropertyPlaceholderHelper(PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_PREFIX,
		PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_SUFFIX,
		PlaceholderConfigurerSupport.DEFAULT_VALUE_SEPARATOR, true);
}
 
开发者ID:marklogic-community,项目名称:ml-javaclient-util,代码行数:6,代码来源:DefaultTokenReplacer.java

示例13: propertyPlaceholderConfigurer

import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; //导入依赖的package包/类
@Bean
public static PlaceholderConfigurerSupport propertyPlaceholderConfigurer() {
    return new PropertySourcesPlaceholderConfigurer();
}
 
开发者ID:mrFlick72,项目名称:socialDocumentLibrary,代码行数:5,代码来源:MongoGridFsApplication.java


注:本文中的org.springframework.beans.factory.config.PlaceholderConfigurerSupport类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。