Java 类org.springframework.core.env.ConfigurablePropertyResolver 实例源码

项目:lams    文件:PropertySourcesPlaceholderConfigurer.java   
/**
 * 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 = 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);
}
项目:spring4-understanding    文件:PropertySourcesPlaceholderConfigurer.java   
/**
 * 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 = 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);
}
项目:my-spring-cache-redis    文件:PropertySourcesPlaceholderConfigurer.java   
/**
 * 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 = 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);
}
项目:spring    文件:PropertySourcesPlaceholderConfigurer.java   
/**
 * 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 = new StringValueResolver() {
        @Override
        public String resolveStringValue(String strVal) {
            String resolved = (ignoreUnresolvablePlaceholders ?
                    propertyResolver.resolvePlaceholders(strVal) :
                    propertyResolver.resolveRequiredPlaceholders(strVal));
            if (trimValues) {
                resolved = resolved.trim();
            }
            return (resolved.equals(nullValue) ? null : resolved);
        }
    };

    doProcessProperties(beanFactoryToProcess, valueResolver);
}
项目:java-platform    文件:ConfigurationPropertySourcesPlaceholderConfigurer.java   
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);
}
项目:elpaaso-core    文件:EncryptablePropertySourcesPlaceholderConfigurer.java   
/**
 * 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,
        final ConfigurablePropertyResolver propertyResolver) throws BeansException {
    propertyResolver.setPlaceholderPrefix(this.placeholderPrefix);
    propertyResolver.setPlaceholderSuffix(this.placeholderSuffix);
    propertyResolver.setValueSeparator(this.valueSeparator);

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

    doProcessProperties(beanFactoryToProcess, valueResolver);
}
项目:class-guard    文件:PropertySourcesPlaceholderConfigurer.java   
/**
 * 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 = new StringValueResolver() {
        public String resolveStringValue(String strVal) {
            String resolved = ignoreUnresolvablePlaceholders ?
                    propertyResolver.resolvePlaceholders(strVal) :
                    propertyResolver.resolveRequiredPlaceholders(strVal);
            return (resolved.equals(nullValue) ? null : resolved);
        }
    };

    doProcessProperties(beanFactoryToProcess, valueResolver);
}
项目:owsi-core-parent    文件:CorePropertyPlaceholderConfigurer.java   
@Override
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess,
        ConfigurablePropertyResolver propertyResolver) throws BeansException {
    this.propertyResolver = propertyResolver;

    // on garde les traitements dans la classe parente
    super.processProperties(beanFactoryToProcess, propertyResolver);
}
项目:slurper-configuration    文件:ConfigPlaceholderConfigurer.java   
protected void processProperties(final ConfigurableListableBeanFactory beanFactoryToProcess, final ConfigurablePropertyResolver propertyResolver) {
    propertyResolver.setPlaceholderPrefix(placeholderPrefix);
    propertyResolver.setPlaceholderSuffix(placeholderSuffix);
    propertyResolver.setValueSeparator(valueSeparator);
    StringValueResolver valueResolver = new StringValueResolver() {
        @Override
        public String resolveStringValue(final String strVal) {
            String resolved = ignoreUnresolvablePlaceholders ? propertyResolver.resolvePlaceholders(strVal) : propertyResolver.resolveRequiredPlaceholders(strVal);
            return resolved.equals(nullValue) ? null : resolved;
        }
    };
    doProcessProperties(beanFactoryToProcess, valueResolver);
}