ossj.common.tck
Class SafeProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by ossj.common.tck.SafeProperties
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>
Direct Known Subclasses:
SysProps, TestProps

public class SafeProperties
extends Properties

Properties subclass which ensures that required properties are available

Version:
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
SafeProperties(String propFilename, String[] keys)
          creates a new SafeProperties instance
 
Method Summary
 boolean containsAllKeys(String[] keys)
          checks if the property file contains all specified keys
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, loadFromXML, propertyNames, save, setProperty, store, storeToXML, storeToXML
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SafeProperties

public SafeProperties(String propFilename,
                      String[] keys)
               throws IOException,
                      IllegalArgumentException
creates a new SafeProperties instance

Parameters:
propFilename - The file to read the properties from
keys - The list of keys which must be present in the property file
Throws:
IOException - If the file cannot be read
IllegalArgumentException - If a required property is missing
Method Detail

containsAllKeys

public boolean containsAllKeys(String[] keys)
checks if the property file contains all specified keys

Parameters:
keys - The list of keys
Returns:
If the object contains all specified keys


Copyright 2002-2006 The Members of the OSS through Java(TM) Initiative. All rights reserved. Use is subject to license terms.