|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.cargo.container.internal.util.PropertyUtils
public final class PropertyUtils
A class to convert properties to strings and back.
| Method Summary | |
|---|---|
static String |
escapeBackSlashesIfNotNull(String in)
Escapes backslashes so that they can parse properly. |
static String |
joinOnDelimiter(Map toJoin,
char delimiter)
Convert properties to a string representation, based on the specified delimiter. |
static String |
joinOnPipe(Map toJoin)
Convert properties to a string representation. |
static String |
joinOnSemicolon(Map toJoin)
Convert properties to a string representation. |
static void |
setPropertyIfNotNull(Properties properties,
String property,
Object value)
Sets a property value if the property is not null. |
static Properties |
splitPropertiesOnDelimiter(String toSplit,
char delimiter)
Construct a Properties object from a single string, by splitting it on a specified delimiter. |
static Properties |
splitPropertiesOnPipe(String toSplit)
Construct a Properties object from a single string, converting '|' symbols to end of line characters for parsing. |
static Properties |
splitPropertiesOnSemicolon(String toSplit)
Construct a Properties object from a single string, converting ';' symbols to end of line characters for parsing. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Properties splitPropertiesOnPipe(String toSplit)
Example: "abc=def|car=bmw" gets converted to "abc" -> "def", and "car" -> "bmw"
toSplit - The string value to convert to properties, pipe separated
getPropertiesFromDelimitedStringpublic static Properties splitPropertiesOnSemicolon(String toSplit)
Example: "abc=def;car=bmw" gets converted to "abc" -> "def", and "car" -> "bmw"
toSplit - The string value to convert to properties, semicolon separated
getPropertiesFromDelimitedString
public static Properties splitPropertiesOnDelimiter(String toSplit,
char delimiter)
Example: "abc=def;car=bmw" gets converted to "abc" -> "def", and "car" -> "bmw" where: delimiter = ;
toSplit - The string value to convert to propertiesdelimiter - The delimiter of the string
public static String joinOnPipe(Map toJoin)
toJoin - A list of properties to convert
public static String joinOnSemicolon(Map toJoin)
toJoin - A list of properties to convert
public static String joinOnDelimiter(Map toJoin,
char delimiter)
toJoin - object to serialize as a stringdelimiter - how to separate entries from each other
public static void setPropertyIfNotNull(Properties properties,
String property,
Object value)
properties - the properties object to store the property intoproperty - the property to setvalue - the value to setpublic static String escapeBackSlashesIfNotNull(String in)
in - - string with backslashes
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||