org.specrunner.properties.core
Class PropertyLoaderImpl

java.lang.Object
  extended by org.specrunner.properties.core.PropertyLoaderImpl
All Implemented Interfaces:
IPropertyLoader

public class PropertyLoaderImpl
extends Object
implements IPropertyLoader

Default implementation of properties loading.

Author:
Thiago Santos

Field Summary
protected static ICache<String,List<Properties>> cache
          Cache of properties.
 
Constructor Summary
PropertyLoaderImpl()
           
 
Method Summary
 List<Properties> load(String file)
          Load a set of properties with the given name.
protected  List<Properties> loadUrls(List<URL> files)
          Load given URLs to a properties object.
protected  void sort(List<Properties> props)
          Sort property files using attribute index to order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected static ICache<String,List<Properties>> cache
Cache of properties.

Constructor Detail

PropertyLoaderImpl

public PropertyLoaderImpl()
Method Detail

load

public List<Properties> load(String file)
                      throws PropertyLoaderException
Description copied from interface: IPropertyLoader
Load a set of properties with the given name.

Specified by:
load in interface IPropertyLoader
Parameters:
file - The file name.
Returns:
The merge of all properties with this name in classpath.
Throws:
PropertyLoaderException - On reading properties errors.

loadUrls

protected List<Properties> loadUrls(List<URL> files)
                             throws PropertyLoaderException
Load given URLs to a properties object.

Parameters:
files - A list of file by URLs.
Returns:
The properties list.
Throws:
PropertyLoaderException - On loading erros.

sort

protected void sort(List<Properties> props)
Sort property files using attribute index to order.

Parameters:
props - The property files list.


Copyright © 2014. All rights reserved.