uk.co.jcp.util.properties
Interface PropertySource
- All Superinterfaces:
- java.io.Serializable
- All Known Subinterfaces:
- WritablePropertySource
- public interface PropertySource
- extends java.io.Serializable
Interface for PropertySources, e.g. INI file, Trustbase properties,
Database etc.
Method Summary |
boolean |
containsSection(java.lang.String sectionName)
|
java.util.Enumeration |
getKeys(java.lang.String section)
Get an enumeration of the keys in the named section |
java.util.Enumeration |
getPropertyValues(java.lang.String section,
java.lang.String key)
Get the set of values held by the named key |
java.util.Enumeration |
getSectionNames()
|
void |
load(java.lang.String source)
Load properties in from the named source |
void |
setProperty(java.lang.String section,
java.lang.String key,
java.lang.Object value)
|
containsSection
public boolean containsSection(java.lang.String sectionName)
- Returns:
- true is the property source contains the named section
getSectionNames
public java.util.Enumeration getSectionNames()
- Returns:
- an enumeration of the section names that are suppoertd by this
source (not including null, the default section)
getKeys
public java.util.Enumeration getKeys(java.lang.String section)
- Get an enumeration of the keys in the named section
- Parameters:
section
- the name of the section to inspect. This can be null
for the default section- Returns:
- an Enumeration of strings
getPropertyValues
public java.util.Enumeration getPropertyValues(java.lang.String section,
java.lang.String key)
- Get the set of values held by the named key
- Parameters:
section
- the name of the section to inspect. This can be null
for the default sectionkey
- the key for the property required- Returns:
- an Enumeration of strings
setProperty
public void setProperty(java.lang.String section,
java.lang.String key,
java.lang.Object value)
throws PropertyException
- Parameters:
section
- the name of the section to inspect. This can be null
for the default sectionkey
- the key for the property required- Throws:
PropertyException
- if the value could not be set
load
public void load(java.lang.String source)
throws PropertyException
- Load properties in from the named source
- Parameters:
source
- the name of the source (e.g. a filename)- Throws:
PropertyException
- if the properties could not be loaded