|
||||||||||
| 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 java.lang.String |
escapeBackSlashesIfNotNull(java.lang.String in)
Escapes backslashes so that they can parse properly. |
static java.lang.String |
joinOnDelimiter(java.util.Map toJoin,
char delimiter)
Convert properties to a string representation, based on the specified delimiter. |
static java.lang.String |
joinOnPipe(java.util.Map toJoin)
Convert properties to a string representation. |
static java.lang.String |
joinOnSemicolon(java.util.Map toJoin)
Convert properties to a string representation. |
static void |
setPropertyIfNotNull(java.util.Properties properties,
java.lang.String property,
java.lang.Object value)
Sets a property value if the property is not null. |
static java.util.Properties |
splitPropertiesOnDelimiter(java.lang.String toSplit,
char delimiter)
Construct a Properties object from a single string, by splitting it on a specified delimiter. |
static java.util.Properties |
splitPropertiesOnPipe(java.lang.String toSplit)
Construct a Properties object from a single string, converting '|' symbols to end of line characters for parsing. |
static java.util.Properties |
splitPropertiesOnSemicolon(java.lang.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 java.util.Properties splitPropertiesOnPipe(java.lang.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 java.util.Properties splitPropertiesOnSemicolon(java.lang.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 java.util.Properties splitPropertiesOnDelimiter(java.lang.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 java.lang.String joinOnPipe(java.util.Map toJoin)
toJoin - A list of properties to convert
public static java.lang.String joinOnSemicolon(java.util.Map toJoin)
toJoin - A list of properties to convert
public static java.lang.String joinOnDelimiter(java.util.Map toJoin,
char delimiter)
toJoin - object to serialize as a stringdelimiter - how to separate entries from each other
public static void setPropertyIfNotNull(java.util.Properties properties,
java.lang.String property,
java.lang.Object value)
properties - the properties object to store the property intoproperty - the property to setvalue - the value to setpublic static java.lang.String escapeBackSlashesIfNotNull(java.lang.String in)
in - - string with backslashes
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||