|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PropertiesUtil
| Field Summary | |
|---|---|
static String |
PROP_SEP
The default separator for property key parts. |
| Method Summary | |
|---|---|
Properties |
addProperties(Properties prop,
Class<?> clazz,
Properties extraProp)
|
Properties |
addProperties(Properties prop,
String baseKey,
Properties extraProp)
|
String |
createKey(String[] keyArray)
Creates a new key value, by concatinating the key with the two
key parts. |
String |
createKey(String key,
String keyPart)
Creates a new key value, by concatinating the key with
the keyPart. |
String |
createKey(String key,
String firstKeyPart,
String secondKeyPart)
Creates a new key value, by concatinating the key with the two
key parts. |
Properties |
getProperties(Class<?> clazz,
Properties prop)
|
Properties |
getProperties(String baseKey,
Properties prop)
Returns a sub set of Properties, which keys start with the baseKey. |
List<Properties> |
getPropertiesList(Properties prop,
String listPrefixKey)
|
List<Properties> |
getPropertiesList(Properties prop,
String listPrefixKey,
String openingBracket,
String closingBracket)
|
Map<String,Properties> |
getPropertiesMap(Properties prop,
String mapPrefixKey)
|
Map<String,Properties> |
getPropertiesMap(Properties prop,
String mapPrefixKey,
String openingBracket,
String closingBracket)
person[tjeerd].name = Mickey Mouse person[tjeerd].mobile = +31.6.1111 1111 person[esther].name = Donald Duck person[estehr].mobile = +31.6.1111 2222 |
List<String> |
getPropertyAsList(Properties properties,
String key)
|
List<String> |
getPropertyAsList(Properties properties,
String key,
String separator)
|
Set<String> |
getPropertyAsSet(Properties properties,
String key)
Returns the values of an multiple value property key as a Set instance, which contains all the values. |
Set<String> |
getPropertyAsSet(Properties properties,
String key,
String separator)
Returns the values of an multiple value property key as a Set instance, which contains all the values. |
Properties |
loadProperties(File propertyFile)
|
String |
toString(Properties properties)
Creates a String which contains all the property key's and their values, separated by the equals sign '='. |
| Field Detail |
|---|
static final String PROP_SEP
| Method Detail |
|---|
String createKey(String key,
String keyPart)
key value, by concatinating the key with
the keyPart.
When createKey(current_key, "window") is called it will return the
String current_key + PROP_SEP + "window".
key - The existing key, to which the keyPart is added.keyPart - The key part to add.
String createKey(String key,
String firstKeyPart,
String secondKeyPart)
key value, by concatinating the key with the two
key parts.
When createKey(current_key, "window", "name") is called it will return the
String current_key + ".window.name".
key - The existing key, to which the keyPart's are added.firstKeyPart - The key part to add.secondKeyPart - The key part to add.
createKey(String, String)String createKey(String[] keyArray)
key value, by concatinating the key with the two
key parts.
When createKey(new String[] {"company", "module", "project"}) is called it will return the
String "company.module.project".
keyArray - An array of key parts which need to be concatinated.
Properties loadProperties(File propertyFile)
Set<String> getPropertyAsSet(Properties properties,
String key)
properties - The Properties instance, from which to get the multiple values.key - The key under which the values are stored.
Set<String> getPropertyAsSet(Properties properties,
String key,
String separator)
properties - The Properties instance, from which to get the multiple values.key - The key under which the values are stored.separator - The separator used to separate the values. If null
is given, the default space ' ' separator is used.
List<String> getPropertyAsList(Properties properties,
String key)
List<String> getPropertyAsList(Properties properties,
String key,
String separator)
String toString(Properties properties)
properties -
Properties getProperties(String baseKey,
Properties prop)
Properties, which keys start with the baseKey.
Creating the Properties instance prop:
web.proxy.hostname = proxy web.proxy.port = 8080 web.application.name = Web applicationAnd using the method
getProperties("web.proxy", prop) will return a new Properties instance
like this:
hostname = proxy port = 8080
baseKey - The key under which the sub set Properties are stored.prop - The Properties from which the sub set is extracted.
Properties getProperties(Class<?> clazz,
Properties prop)
Properties addProperties(Properties prop,
String baseKey,
Properties extraProp)
Properties addProperties(Properties prop,
Class<?> clazz,
Properties extraProp)
List<Properties> getPropertiesList(Properties prop,
String listPrefixKey)
List<Properties> getPropertiesList(Properties prop,
String listPrefixKey,
String openingBracket,
String closingBracket)
Map<String,Properties> getPropertiesMap(Properties prop,
String mapPrefixKey)
Map<String,Properties> getPropertiesMap(Properties prop,
String mapPrefixKey,
String openingBracket,
String closingBracket)
person[tjeerd].name = Mickey Mouse person[tjeerd].mobile = +31.6.1111 1111 person[esther].name = Donald Duck person[estehr].mobile = +31.6.1111 2222
person(01).name = Mickey Mouse person(01).mobile = +31.6.1111 1111 person(02).name = Donald Duck person(02).mobile = +31.6.1111 2222
prop - mapPrefixKey - openingBracket - closingBracket -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||