Spring Framework PropertySource - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework PropertySource class.

This code example shows how to use the following methods:containsProperty, getProperty
This code example shows how to use the following methods:getProperty
     * This enables overriding the env-${envTarget}.properties location, which is by default resolved internally from the classpath. The entire purpose of overriding this specific properties file is to be able to control 
     * the active Spring profile without defining system wide variables on the OS that runs staging 
     */ 
    private final String getTargetFromOverride() {
        try { 
            final ResourcePropertySource overrideProperties = new ResourcePropertySource("file:///opt/override/overrides.properties");
            return (String) overrideProperties.getProperty(ENV_TARGET);
        } catch (final IOException e) {
            logger.trace("The file overrides.properties is not accessible. No property overridden by external properties"); 
        } 
 
        return null; 
    } 
 
} 
4
CodeRank
This code example shows how to use the following methods:getSource
		super(configNode.getNode(), configNode); 
	} 
 
	@Override 
	public Object getProperty(String name) { 
		return super.getSource().getProperty(name); 
	} 
 
 
} 
4
CodeRank
This code example shows how to use the following methods:
package com.habuma.spring31.property; 
import org.springframework.core.env.PropertySource;
 
public class ChuckNorrisPropertySource extends PropertySource<Object> {
	public ChuckNorrisPropertySource(String name) {
		super(name);
	} 
 
	@Override 
	public Object getProperty(String name) {
		System.out.println("Chuck says...");
		return "Roundhouse Kick"; 
	} 
} 
4
CodeRank
See Code Examples for Spring Framework PropertySource Methods: