Package adams.core
Class StaticClassLister
- java.lang.Object
-
- adams.core.StaticClassLister
-
- All Implemented Interfaces:
Serializable
public class StaticClassLister extends Object implements Serializable
Loads class names listed in props files, for cases when dynamic class discovery is not available (e.g., JUnit tests).- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static StaticClassListerm_Singletonthe singleton.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]getClassnames(String[] propsfiles, String key)Loads the classnames from all propsfiles that can be found with the classloader, using the specified key.String[]getClassnames(String propsfile, String key)Loads the classnames from all propsfiles that can be found with the classloader, using the specified key.String[]getClassnames(List<String> propsfiles, String key)Loads the classnames from all propsfiles that can be found with the classloader, using the specified key.static StaticClassListergetSingleton()Returns the singleton instance.protected List<URL>locate(String resource)Locates the resource and returns the URLs.
-
-
-
Field Detail
-
m_Singleton
protected static StaticClassLister m_Singleton
the singleton.
-
-
Method Detail
-
getClassnames
public String[] getClassnames(String propsfile, String key)
Loads the classnames from all propsfiles that can be found with the classloader, using the specified key.- Parameters:
propsfile- the resource (properties file) to look forkey- the key in the props file to retrieve the classnames from- Returns:
- the retrieved classnames
-
locate
protected List<URL> locate(String resource)
Locates the resource and returns the URLs.- Parameters:
resource- the resource to locate- Returns:
- the URLs the resource was found at
-
getClassnames
public String[] getClassnames(List<String> propsfiles, String key)
Loads the classnames from all propsfiles that can be found with the classloader, using the specified key.- Parameters:
propsfiles- the resources (properties file) to look forkey- the key in the props files to retrieve the classnames from- Returns:
- the retrieved classnames
-
getClassnames
public String[] getClassnames(String[] propsfiles, String key)
Loads the classnames from all propsfiles that can be found with the classloader, using the specified key.- Parameters:
propsfiles- the resources (properties file) to look forkey- the key in the props files to retrieve the classnames from- Returns:
- the retrieved classnames
-
getSingleton
public static StaticClassLister getSingleton()
Returns the singleton instance.- Returns:
- the singleton
-
-