public final class PropertyUtils extends Object
Modifier and Type | Method and Description |
---|---|
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.
|
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 separatedgetPropertiesFromDelimitedString
public 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 separatedgetPropertiesFromDelimitedString
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 stringpublic static String joinOnPipe(Map toJoin)
toJoin
- A list of properties to convertpublic static String joinOnSemicolon(Map toJoin)
toJoin
- A list of properties to convertpublic static String joinOnDelimiter(Map toJoin, char delimiter)
toJoin
- object to serialize as a stringdelimiter
- how to separate entries from each otherpublic 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 setCopyright © 2004-2013 Codehaus. All Rights Reserved.