ossj.common.tck
Class SafeProperties
java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
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
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 |
SafeProperties
public SafeProperties(String propFilename,
String[] keys)
throws IOException,
IllegalArgumentException
- creates a new SafeProperties instance
- Parameters:
propFilename
- The file to read the properties fromkeys
- 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
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.