|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.net.util.Properties
Helper class for manipulating string property maps.
Constructor Summary | |
Properties(java.util.Map properties,
java.lang.String prefix)
Construct a new Properties . |
|
Properties(java.lang.String prefix)
Construct a new Properties . |
Method Summary | |
java.lang.String |
get(java.lang.String name)
Returns the value of a property. |
boolean |
getBoolean(java.lang.String name,
boolean defaultValue)
Returns the value of a boolean property. |
int |
getInt(java.lang.String name,
int defaultValue)
Returns the value of an integer property. |
java.util.Map |
getProperties()
Returns the underlying properties. |
URI |
getURI(java.lang.String name)
Returns the value of an URI property. |
void |
set(java.lang.String name,
boolean value)
Adds a boolean property to the underlying map, as a String. |
void |
set(java.lang.String name,
int value)
Adds an integer property to the underlying map, as a String. |
void |
set(java.lang.String name,
java.lang.Object value)
Adds an object property to the underlying map, as a String. |
void |
set(java.lang.String name,
java.lang.String value)
Adds a property to the underlying map. |
void |
setNonNull(java.lang.String name,
java.lang.Object value)
Adds an object property to the underlying map, as a String, iff its value is non-null. |
void |
setNonNull(java.lang.String name,
java.lang.String value)
Adds a property to the underlying map, iff its value is non-null. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Properties(java.lang.String prefix)
Properties
.prefix
- the property name prefix. If non-null, this is
prepended to unqualified property names.public Properties(java.util.Map properties, java.lang.String prefix)
Properties
.properties
- the properties to use. May be null
prefix
- the property name prefix. If non-null, this is
prepended to property names before performing lookupsMethod Detail |
public void set(java.lang.String name, java.lang.String value)
name
- the property namevalue
- the property value. May be null
public void setNonNull(java.lang.String name, java.lang.String value)
name
- the property namevalue
- the property valuepublic void set(java.lang.String name, boolean value)
name
- the property namevalue
- the property valuepublic void set(java.lang.String name, int value)
name
- the property namevalue
- the property valuepublic void set(java.lang.String name, java.lang.Object value)
name
- the property namevalue
- the property valuepublic void setNonNull(java.lang.String name, java.lang.Object value)
name
- the property namevalue
- the property valuepublic java.lang.String get(java.lang.String name) throws ResourceException
name
- the property namenull
if none can be
foundResourceException
- if the property isn't a stringpublic boolean getBoolean(java.lang.String name, boolean defaultValue) throws ResourceException
name
- the property namedefaultValue
- the value to return if the property doesn't exist.defaultValue
if none can
be foundResourceException
- if the property isn't a valid booleanpublic int getInt(java.lang.String name, int defaultValue) throws ResourceException
name
- the property namedefaultValue
- the value to return if the property doesn't exist.defaultValue
if none can
be foundResourceException
- if the property isn't a valid integerpublic URI getURI(java.lang.String name) throws ResourceException
name
- the property namenull
if none can be foundResourceException
- if the URI is invalidpublic java.util.Map getProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |