org.openejb.util
Class SafeProperties

java.lang.Object
  extended by org.openejb.util.SafeProperties

public class SafeProperties
extends java.lang.Object


Constructor Summary
SafeProperties(java.util.Properties props, java.lang.String systemLocation)
          Creates a new SafeProperties usign the Properties object passed in.
 
Method Summary
 java.lang.String getProperty(java.lang.String key)
          Returns the value of the key.
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Returns the value of the key.
 boolean getPropertyAsBoolean(java.lang.String key)
          Returns the value of the key as an boolean.
 java.lang.Boolean getPropertyAsBoolean(java.lang.String key, java.lang.Boolean defaultValue)
          Returns the value of the key as an boolean.
 int getPropertyAsInt(java.lang.String key)
          Returns the value of the key as an int.
 int getPropertyAsInt(java.lang.String key, int defaultValue)
          Returns the value of the key as an int.
 java.lang.Integer getPropertyAsInteger(java.lang.String key)
          Returns the value of the key as an Integer.
 java.lang.Integer getPropertyAsInteger(java.lang.String key, java.lang.Integer defaultValue)
          Returns the value of the key as an Integer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SafeProperties

public SafeProperties(java.util.Properties props,
                      java.lang.String systemLocation)
               throws OpenEJBException
Creates a new SafeProperties usign the Properties object passed in.

Throws:
OpenEJBExcption - if the properties object passed in is null.
OpenEJBException
Method Detail

getProperty

public java.lang.String getProperty(java.lang.String key)
                             throws OpenEJBException
Returns the value of the key.

Throws:
OpenEJBException - if the property does not exist or is null.

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
                             throws OpenEJBException
Returns the value of the key.

Throws:
OpenEJBException - if the property does not exist or is null.

getPropertyAsInt

public int getPropertyAsInt(java.lang.String key)
                     throws OpenEJBException
Returns the value of the key as an int.

Throws:
OpenEJBException - if the property does not exist, is null, or cannot be converted to an int.

getPropertyAsInt

public int getPropertyAsInt(java.lang.String key,
                            int defaultValue)
                     throws OpenEJBException
Returns the value of the key as an int.

Throws:
OpenEJBException - if the property does not exist, is null, or cannot be converted to an int.

getPropertyAsInteger

public java.lang.Integer getPropertyAsInteger(java.lang.String key,
                                              java.lang.Integer defaultValue)
                                       throws OpenEJBException
Returns the value of the key as an Integer.

Throws:
OpenEJBException - if the property does not exist, is null, or cannot be converted to an Integer.

getPropertyAsInteger

public java.lang.Integer getPropertyAsInteger(java.lang.String key)
                                       throws OpenEJBException
Returns the value of the key as an Integer.

Throws:
OpenEJBException - if the property does not exist, is null, or cannot be converted to an Integer.

getPropertyAsBoolean

public boolean getPropertyAsBoolean(java.lang.String key)
                             throws OpenEJBException
Returns the value of the key as an boolean.

Throws:
OpenEJBException

getPropertyAsBoolean

public java.lang.Boolean getPropertyAsBoolean(java.lang.String key,
                                              java.lang.Boolean defaultValue)
                                       throws OpenEJBException
Returns the value of the key as an boolean.

Throws:
OpenEJBException


Copyright © 1999-2011 OpenEJB. All Rights Reserved.