|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<String,Object>
org.tinyjee.maven.dim.extensions.PropertiesLoader
public class PropertiesLoader
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)}
%{include|source=template.vm|source-properties=props.(xml|properties)}
Nested Class Summary | |
---|---|
static class |
PropertiesLoader.AliasHandler
Implements the " PARAM_ALIAS " alias functionality. |
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Field Summary | |
---|---|
static String |
OUT_PARAM_LOADED_PROPERTIES
Is filled with the loaded Properties instance. |
static String |
OUT_PARAM_LOADED_PROPERTY_KEYS
Is filled with a sorted, regex-enabled list of property keys (= new ). |
static String |
PARAM_ALIAS
Defines a shortcut for the request properties ' source-class ' and 'properties '. |
static String |
PARAM_PROPERTIES
Sets the path to the properties file to load inside the request parameters. |
Constructor Summary | |
---|---|
PropertiesLoader(File baseDir, Map<String,Object> requestParams)
Constructs a new properties loader searching for properties using the given base path. |
Method Summary |
---|
Methods inherited from class java.util.LinkedHashMap |
---|
clear, containsValue, get, removeEldestEntry |
Methods inherited from class java.util.HashMap |
---|
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Field Detail |
---|
public static final String PARAM_ALIAS
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.
public static final String PARAM_PROPERTIES
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.
public static final String OUT_PARAM_LOADED_PROPERTIES
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()
.
public static final String OUT_PARAM_LOADED_PROPERTY_KEYS
new SelectableArrayList
<String>(new TreeSet<String>(properties.keySet()));
).
Constructor Detail |
---|
public PropertiesLoader(File baseDir, Map<String,Object> requestParams)
baseDir
- the base dir to of the maven module.requestParams
- the request params of the macro call.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |