public class LocalizedProperties extends java.lang.Object
Constructor and Description |
---|
LocalizedProperties()
Create a new object with an empty property storage
|
LocalizedProperties(java.util.Map propertyMap)
Use the provided argument as the storage location for the properties managed
by this object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getProperty(java.lang.String key)
Returns the property value corresponding the provided key.
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Returns the property value corresponding to the provided key,
or the provided default value if no such property exists.
|
java.util.Map |
getPropertyMap()
Returns the map containing all properties.
|
void |
load(java.io.InputStream ins)
Loads the properties from the given stream using the default character encoding.
|
void |
load(java.io.InputStream ins,
java.lang.String encoding)
Loads the properties from the given stream using the provided character encoding.
|
void |
load(java.io.Reader reader)
Loads the properties from the given reader.
|
void |
setProperty(java.lang.String key,
java.lang.String value)
Stores a property value
|
public LocalizedProperties()
public LocalizedProperties(java.util.Map propertyMap)
propertyMap
- the map where properties are to be storedpublic java.lang.String getProperty(java.lang.String key)
key
- the property keypublic java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
key
- the property keydefaultValue
- the default value of the propertypublic void setProperty(java.lang.String key, java.lang.String value)
key
- the property keyvalue
- the property valuepublic java.util.Map getPropertyMap()
public void load(java.io.InputStream ins) throws java.io.IOException
Properties
,
but it also handles non-ascii symbols.ins
- the stream to load the properties fromjava.io.IOException
public void load(java.io.InputStream ins, java.lang.String encoding) throws java.io.UnsupportedEncodingException, java.io.IOException
Properties
,
but it also handles non-ascii symbols.ins
- the stream to load the properties fromencoding
- the encoding the use when parsing the streamjava.io.IOException
java.io.UnsupportedEncodingException
public void load(java.io.Reader reader) throws java.io.IOException
Properties
,
but it also handles non-ascii symbols.reader
- the reader to load the properties fromjava.io.IOException