Spring Framework DefaultPropertiesPersister - 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 DefaultPropertiesPersister class.

This code example shows how to use the following methods:
	 * @throws IOException in case of I/O errors 
	 */ 
	public static void fillProperties(Properties props, EncodedResource resource)
			throws IOException {
 
		fillProperties(props, resource, new DefaultPropertiesPersister());
	} 
 
	/** 
	 * Actually load properties from the given EncodedResource into the given Properties instance. 
	 * @param props the Properties instance to load into 
	 * @param resource the resource to load from 
	 * @param persister the PropertiesPersister to use 
	 * @throws IOException in case of I/O errors 
	 */ 
	static void fillProperties(Properties props, EncodedResource resource, PropertiesPersister persister)
			throws IOException {
 
		InputStream stream = null;
		Reader reader = null;
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 *  
 * @see PropertiesPersister 
 */ 
public final class PropertiesConverter { 
 
	private static final PropertiesPersister propertiesPersister = new DefaultPropertiesPersister();
 
	private static final String LINE_SEPARATOR = System.getProperty("line.separator");
 
	// prevents the class from being instantiated 
	private PropertiesConverter() { 
	} 
 
	/** 
	 * Parse a String to a Properties object. If string is null, an empty 
	 * Properties object will be returned. The input String is a set of 
	 * name=value pairs, delimited by either newline or comma (for brevity). If 
	 * the input String contains a newline it is assumed that the separator is 
	 * newline, otherwise comma. 
	 *  
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
	private final Log logger = LogFactory.getLog(getClass());
 
	private final Properties metadata = new Properties();
 
	private final DefaultPropertiesPersister persister = new DefaultPropertiesPersister();
 
	private final LockRegistry lockRegistry = new DefaultLockRegistry();
 
	private String baseDirectory = System.getProperty("java.io.tmpdir") + "/spring-integration/";
 
	private File file;
 
 
	public void setBaseDirectory(String baseDirectory) {
		Assert.hasText(baseDirectory, "'baseDirectory' must be non-empty");
		this.baseDirectory = baseDirectory;
	} 
 
	@Override 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 * from incoming properties.  
 *  
 * @author shane frensley 
 * @see org.springframework.util.DefaultPropertiesPersister 
 */ 
public class AlfrescoPropertiesPersister extends DefaultPropertiesPersister 
{ 
	 
	private static Log logger = LogFactory.getLog(AlfrescoPropertiesPersister.class);
 
	@Override 
	public void load(Properties props, InputStream is) throws IOException 
	{ 
		super.load(props, is);
		strip(props);
	} 
	 
	@Override 
	public void load(Properties props, Reader reader) throws IOException
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	public static final String CONSTRUCTOR_ARG_PREFIX = "$";
 
 
	private String defaultParentBean;
 
	private PropertiesPersister propertiesPersister = new DefaultPropertiesPersister();
 
 
	/** 
	 * Create new PropertiesBeanDefinitionReader for the given bean factory. 
	 * @param registry the BeanFactory to load bean definitions into, 
	 * in the form of a BeanDefinitionRegistry 
	 */ 
	public PropertiesBeanDefinitionReader(BeanDefinitionRegistry registry) {
		super(registry);
	} 
 
 
	/** 
	 * Set the default parent bean for this bean factory. 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
	private volatile boolean fallbackToSystemLocale = true;
 
	private volatile long cacheMillis = -1;
 
	private volatile PropertiesPersister propertiesPersister = new DefaultPropertiesPersister();
 
	private volatile ResourceLoader resourceLoader = new DefaultResourceLoader();
 
	/** Cache to hold filename lists per Locale */ 
	private final Map<String, Map<Locale, List<String>>> cachedFilenames =
			new HashMap<String, Map<Locale, List<String>>>();
 
	/** Cache to hold already loaded properties per filename */ 
	private final Map<String, PropertiesHolder> cachedProperties = new HashMap<String, PropertiesHolder>();
 
	/** Cache to hold merged loaded properties per locale */ 
	private final Map<Locale, PropertiesHolder> cachedMergedProperties = new HashMap<Locale, PropertiesHolder>();
 
	private final ExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
    public JsonPropertiesPersister() { 
        this(new ObjectMapper()); 
    } 
 
    public JsonPropertiesPersister(ObjectMapper mapper) {
        this.mapper = mapper;
    } 
 
    @Override 
    public void load(Properties props, InputStream is) throws IOException {
        load(props, new InputStreamReader(is));
    } 
 
    /** 
     * We want to traverse map representing Json object and each time we find String:String pair we want to 
     * save it as Property. As we are going deeper into map we generate compound key as path-like String 
     * 
     * @param props 
     * @param reader 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
	private long cacheMillis = -1;
 
	private boolean concurrentRefresh = true;
 
	private PropertiesPersister propertiesPersister = new DefaultPropertiesPersister();
 
	private ResourceLoader resourceLoader = new DefaultResourceLoader();
 
	/** Cache to hold filename lists per Locale */ 
	private final ConcurrentMap<String, Map<Locale, List<String>>> cachedFilenames =
			new ConcurrentHashMap<String, Map<Locale, List<String>>>();
 
	/** Cache to hold already loaded properties per filename */ 
	private final ConcurrentMap<String, PropertiesHolder> cachedProperties =
			new ConcurrentHashMap<String, PropertiesHolder>();
 
	/** Cache to hold merged loaded properties per locale */ 
	private final ConcurrentMap<Locale, PropertiesHolder> cachedMergedProperties =
			new ConcurrentHashMap<Locale, PropertiesHolder>();
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
	private static final String DEFAULT_ENCODING = "UTF-8";
 
	private static Logger logger = LoggerFactory.getLogger(PropertiesUtils.class); 
 
	private static PropertiesPersister propertiesPersister = new DefaultPropertiesPersister();
	private static ResourceLoader resourceLoader = new DefaultResourceLoader();
 
	/** 
	 * 载入多个properties文件, 相同的属性在最后载入的文件中的值将会覆盖之前的载入. 
	 * 文件路径使用Spring Resource格式, 文件编码使用UTF-8. 
	 *  
	 * @param resourcesPaths Spring Resource path 
	 */ 
	public static Properties loadProperties(String... resourcesPaths) {
		Properties props = new Properties();
 
		for (String location : resourcesPaths) {
 
			logger.debug("Loading properties file from:" + location);
4
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Spring Framework DefaultPropertiesPersister Methods: