java.lang.Object
org.apache.wicket.resource.PropertiesFactory
- All Implemented Interfaces:
IPropertiesFactory
Default implementation of
IPropertiesFactory
which uses the
IResourceStreamLocator
as defined by
ResourceSettings.getResourceStreamLocator()
to load the Properties
objects. Depending on the settings, it will assign
ModificationWatcher
s to the loaded resources to support reloading.- Author:
- Juergen Donnerstag
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(IPropertiesChangeListener listener) Add a listener which will be called when a change to the underlying resource stream (e.g.protected void
addToWatcher
(String path, IResourceStream resourceStream, IModificationWatcher watcher) Add the resource stream to the file being watchedfinal void
Remove all cached properties.protected final Map<String,
Properties> getCache()
For subclasses to get access to the cacheGets theList
of properties loader.Load the properties associated with the pathprotected ValueMap
loadFromLoader
(IPropertiesLoader loader, IResourceStream resourceStream) protected Map<String,
Properties>
-
Constructor Details
-
PropertiesFactory
Construct.- Parameters:
context
- context for properties factory
-
-
Method Details
-
getPropertiesLoaders
Gets theList
of properties loader. You may add or remove properties loaders at your will.- Returns:
- the
List
of properties loader
-
newPropertiesCache
- Returns:
- new Cache implementation
-
addListener
Description copied from interface:IPropertiesFactory
Add a listener which will be called when a change to the underlying resource stream (e.g. properties file) has been detected- Specified by:
addListener
in interfaceIPropertiesFactory
- See Also:
-
clearCache
Description copied from interface:IPropertiesFactory
Remove all cached properties.- Specified by:
clearCache
in interfaceIPropertiesFactory
- See Also:
-
load
Description copied from interface:IPropertiesFactory
Load the properties associated with the path- Specified by:
load
in interfaceIPropertiesFactory
- Parameters:
clazz
- The class requesting the propertiespath
- The path to identify the resource- Returns:
- The properties
-
loadFromLoader
- Parameters:
loader
-resourceStream
-- Returns:
- properties
-
addToWatcher
protected void addToWatcher(String path, IResourceStream resourceStream, IModificationWatcher watcher) Add the resource stream to the file being watched- Parameters:
path
-resourceStream
-watcher
-
-
getCache
For subclasses to get access to the cache- Returns:
- Map
-