Class PropertiesHolder
java.lang.Object
org.apache.commons.discovery.tools.PropertiesHolder
Holder for a default class.
Class may be specified by name (String) or class (Class).
Using the holder complicates the users job, but minimized # of API's.
-
Constructor Summary
ConstructorsConstructorDescriptionPropertiesHolder
(String propertiesFileName) Creates a newPropertiesHolder
instance given a property file name.PropertiesHolder
(Properties properties) Creates a newPropertiesHolder
instance given an already loadProperties
set. -
Method Summary
Modifier and TypeMethodDescriptiongetProperties
(SPInterface<?> spi, ClassLoaders loaders) Returns theProperties
instance, loaded if necessary frompropertiesFileName
.Returns the property file name
-
Constructor Details
-
PropertiesHolder
Creates a newPropertiesHolder
instance given an already loadProperties
set.- Parameters:
properties
- The already loadProperties
set
-
PropertiesHolder
Creates a newPropertiesHolder
instance given a property file name.- Parameters:
propertiesFileName
- The property file name
-
-
Method Details
-
getProperties
Returns theProperties
instance, loaded if necessary frompropertiesFileName
.- Parameters:
spi
- Optional SPI (may be null). If provided, an attempt is made to load the property file as-per Class.getResource().loaders
- Used only if properties need to be loaded.- Returns:
- The
Properties
, loaded if necessary.
-
getPropertiesFileName
Returns the property file name- Returns:
- The property file name
-