com.liferay.portal.kernel.util
Class UnicodeProperties
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,String>
com.liferay.portal.kernel.util.UnicodeProperties
- All Implemented Interfaces:
- Serializable, Cloneable, Map<String,String>
public class UnicodeProperties
- extends HashMap<String,String>
This is a rewrite of java.util.Properties that is not synchronized and
natively supports non-ASCII encodings. It can also be configured to be
"safe", allowing the values to have new line characters. When stored to a
given BufferedWriter, "safe" properties will replace all new line characters
with a _SAFE_NEWLINE_CHARACTER_.
In its current form, this is not intended to replace java.util.Properties for
reading properties flat files. This class is not thread-safe.
- See Also:
- Serialized Form
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, size, values |
UnicodeProperties
public UnicodeProperties()
UnicodeProperties
public UnicodeProperties(boolean safe)
fastLoad
public void fastLoad(String props)
getProperty
public String getProperty(String key)
getProperty
public String getProperty(String key,
String defaultValue)
isSafe
public boolean isSafe()
load
public void load(String props)
throws IOException
- Throws:
IOException
put
public void put(String line)
put
public String put(String key,
String value)
- Specified by:
put
in interface Map<String,String>
- Overrides:
put
in class HashMap<String,String>
remove
public String remove(Object key)
- Specified by:
remove
in interface Map<String,String>
- Overrides:
remove
in class HashMap<String,String>
setProperty
public String setProperty(String key,
String value)
toSortedString
public String toSortedString()
toString
public String toString()
- Overrides:
toString
in class AbstractMap<String,String>
getToStringLength
protected int getToStringLength()