org.tinyjee.maven.dim.extensions
Class PropertiesLoader
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<String,Object>
org.tinyjee.maven.dim.extensions.PropertiesLoader
- All Implemented Interfaces:
- Serializable, Cloneable, Map<String,Object>
- Direct Known Subclasses:
- PropertiesLoader
public class PropertiesLoader
- extends LinkedHashMap<String,Object>
PropertiesLoader is a 'source-class' compatible helper class that can load a properties file
and add or overwrite the request properties by the properties contained in the file.
Usage:
%{include|source=template.vm|source-class=org.tinyjee.maven.dim.extensions.PropertiesLoader|properties=props.(xml|properties)}
or when using the alias:
%{include|source=template.vm|source-properties=props.(xml|properties)}
- Version:
- 1.0
- Author:
- Juergen_Kellerer, 2010-09-08
- See Also:
- Serialized Form
Methods inherited from interface java.util.Map |
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
PARAM_ALIAS
public static final String PARAM_ALIAS
- Defines a shortcut for the request properties '
source-class
' and 'properties
'.
If this parameter is present inside the request parameters list, the system
will effectively behave as if 'source-class' and 'properties' where set
separately.
- See Also:
- Constant Field Values
PARAM_PROPERTIES
public static final String PARAM_PROPERTIES
- Sets the path to the properties file to load inside the request parameters.
The specified file is retrieved in exactly the same way as if the "
source
"
parameter would have been used (see Macro reference).
Note: Properties can use the traditional .properties
or
the newer .xml
format. Format selection is performed by file extension.
- See Also:
- Constant Field Values
OUT_PARAM_LOADED_PROPERTIES
public static final String OUT_PARAM_LOADED_PROPERTIES
- Is filled with the loaded
Properties
instance.
Note: All loaded properties are exposed in the standard scope as request properties and are accessible
like any other parameters specified with the macro call.
This additional map based access allows to query properties whose names are not compatible with the variable naming
scheme and it also allows to iterate all loaded properties using $loadedProperties.entrySet()
.
- See Also:
- Constant Field Values
OUT_PARAM_LOADED_PROPERTY_KEYS
public static final String OUT_PARAM_LOADED_PROPERTY_KEYS
- Is filled with a sorted, regex-enabled list of property keys (=
new SelectableArrayList
<String>(new TreeSet<String>(properties.keySet()));
).
- See Also:
- Constant Field Values
PropertiesLoader
public PropertiesLoader(File baseDir,
Map<String,Object> requestParams)
- Constructs a new properties loader searching for properties using the given base path.
- Parameters:
baseDir
- the base dir to of the maven module.requestParams
- the request params of the macro call.