Liferay 6.1.2-ce-ga3

com.liferay.portal.kernel.util
Class UnicodeProperties

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<String,String>
          extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
UnicodeProperties()
           
UnicodeProperties(boolean safe)
           
 
Method Summary
 void fastLoad(String props)
           
 String getProperty(String key)
           
 String getProperty(String key, String defaultValue)
           
protected  int getToStringLength()
           
 boolean isSafe()
           
 void load(String props)
           
 void put(String line)
           
 String put(String key, String value)
           
 String remove(Object key)
           
 String setProperty(String key, String value)
           
 String toSortedString()
           
 String toString()
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

UnicodeProperties

public UnicodeProperties()

UnicodeProperties

public UnicodeProperties(boolean safe)
Method Detail

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()

Liferay 6.1.2-ce-ga3