|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sourceforge.jpatterns.core.configuration.PropertiesProvider
public class PropertiesProvider
This class would store the properties per the key. The values are defined at the properties file of the JPatterns.
The storage would be the Map, the initialization of the properties would be performed at this class (method #init).
Please remember that the priority has custom properties files
(PropertiesManagerImpl.m_customBundle
),
and then the default bundle is asked to provide the property:
(PropertiesManagerImpl.m_defaultBundle
).
Please review properly the following Java Docs - it is important for understanding of the algorithm of working of the JPatterns
configuration functionality.
com.sourceforge.jpatterns.core.configuration.PropertiesProvider.JPProperties.USE_ONLY_CUSTOM_FRAMEWORK_PROPERTIES
todo: [zmicer] think over the moving this functionality to the common utility/framework.
Also important feature in the behaviour of this class is: it won't store the keys/values which define the implementations of the
interfaces/abstract classes. It is done in the following way. We would check the values of the properties trying to instantiate the
appropriate classes instances. If it is done succesfully - we would exclude such values.
$Author:: zmicer $
$Rev:: 67 $
* $Date:: 2007-08-28 21:37:07 #$
$Date:: 2007-08-28 21:37:07 #$
Nested Class Summary | |
---|---|
static interface |
PropertiesProvider.JPProperties
This interface stores the keys for necessary and important for the JPatterns properties. |
static class |
PropertiesProvider.OverridingDepths
This enum defines the depths we could use for the defining the overriding types. |
Field Summary | |
---|---|
static org.apache.log4j.Logger |
LOG
Logger instance. |
Method Summary | |
---|---|
protected void |
checkIfInitialized()
Check if the PropertiesProvider was iinitialized. |
Boolean |
getBooleanProperty(String key)
|
static PropertiesProvider |
getInstance(IPropertiesManager manager,
boolean reloadAnyWay)
Get instance of the PropertiesProvider. |
String |
getStringProperty(String key)
|
protected void |
init(IPropertiesManager manager)
Init method - initializes the provided. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.log4j.Logger LOG
Method Detail |
---|
protected void init(IPropertiesManager manager)
manager
- the manager, entry point to the properties values.
Can not be null (otherwise IllegalArgumentException
would appear).public static PropertiesProvider getInstance(IPropertiesManager manager, boolean reloadAnyWay)
manager
- is necessary for the initializing properties values (if they are initialized already - it is just skipped.)
Can not be null (otherwise IllegalArgumentException
would appear).reloadAnyWay
- says to reload the properties anyway. It could be used at the unit tests. In the normal life - it should
be set to false;
public Boolean getBooleanProperty(String key)
key
- The key to retrieve the appropriate value. Can not be null (otherwise IllegalArgumentException
would appear).
Please use the values of JPProperties (surely having the boolean sense).
public String getStringProperty(String key)
key
- The key to retrieve the appropriate value. Can not be null (otherwise IllegalArgumentException
would appear).
Please use the values of JPProperties (surely having the boolean sense).
protected void checkIfInitialized()
PropertiesProvider
was iinitialized.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |