Package org.springframework.util

Examples of org.springframework.util.PropertyPlaceholderHelper$PlaceholderResolver


    protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) throws BeansException {
        super.processProperties(beanFactoryToProcess, props);
        // store all the spring properties so we can refer to them later
        properties.putAll(props);
        // create helper
        helper = new PropertyPlaceholderHelper(
                configuredPlaceholderPrefix != null ? configuredPlaceholderPrefix : DEFAULT_PLACEHOLDER_PREFIX,
                configuredPlaceholderSuffix != null ? configuredPlaceholderSuffix : DEFAULT_PLACEHOLDER_SUFFIX,
                configuredValueSeparator != null ? configuredValueSeparator : DEFAULT_VALUE_SEPARATOR,
                configuredIgnoreUnresolvablePlaceholders != null ? configuredIgnoreUnresolvablePlaceholders : false);
    }
View Full Code Here


    private PlaceholderResolver resolver;

    public SpelView(String template) {
      this.template = template;
      this.context.addPropertyAccessor(new MapAccessor());
      this.helper = new PropertyPlaceholderHelper("${", "}");
      this.resolver = new SpelPlaceholderResolver(this.context);
    }
View Full Code Here

     * @param properties the merged context properties
     */
    public static void processProperties(final Properties properties,
        String placeholderPrefix, String placeholderSuffix)
    {
        PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper(
                placeholderPrefix, placeholderSuffix);
        PropertyPlaceholderHelper.PlaceholderResolver resolver = new PropertyPlaceholderHelper.PlaceholderResolver()
        {
            @Override
            public String resolvePlaceholder(String placeholderName)
            {
                // SYSTEM_PROPERTIES_MODE_OVERRIDE means we look at previously set
                // system properties in preference to properties defined in our file
                String value = System.getProperty(placeholderName);
                if (value == null)
                    value = properties.getProperty(placeholderName);
                return value;
            }
        };

        for (Object key : properties.keySet())
        {
            String propertyName = (String) key;
            // get the value from the map
            String propertyValue = properties.getProperty(propertyName);
            // resolve it against system properties then other properties in the
            // passed-in Properties
            String resolvedValue = helper.replacePlaceholders(propertyValue,
                    resolver);

            // set back into passed-in Properties if changed
            if (!ObjectUtils.nullSafeEquals(propertyValue, resolvedValue))
            {
View Full Code Here

TOP

Related Classes of org.springframework.util.PropertyPlaceholderHelper$PlaceholderResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.