net.walend.property
Interface PropertySource

All Known Implementing Classes:
SimplePropertySource, SubsetPropertySource

public interface PropertySource

This interface defines a source of String Properties.

Since:
20001130
Author:
David Walend

Method Summary
 java.lang.String getPrefix()
          Return the String prefix for this PropertySource.
 java.lang.String getProperty(java.lang.String key)
          If the property isn't there, return null.
 java.lang.String getProperty(java.lang.String key, java.lang.String def)
          If the property isn't there, return default.
 java.lang.String getPropertySafely(java.lang.String key)
           
 PropertySource getSubsetPropertySource(java.lang.String keyPrefix)
          Return a PropertySource that contains the subset of these properties based on the prefix.
 java.util.Iterator propertyIterator()
          Return an iterator of property keys.
 void setProperty(java.lang.String key, java.lang.String value)
          Add or change the value of a property.
 

Method Detail

getProperty

public java.lang.String getProperty(java.lang.String key)
If the property isn't there, return null.


getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String def)
If the property isn't there, return default.


getPropertySafely

public java.lang.String getPropertySafely(java.lang.String key)
Throws:
PropertyException - if the property isn't there.

propertyIterator

public java.util.Iterator propertyIterator()
Return an iterator of property keys.


getPrefix

public java.lang.String getPrefix()
Return the String prefix for this PropertySource.


getSubsetPropertySource

public PropertySource getSubsetPropertySource(java.lang.String keyPrefix)
Return a PropertySource that contains the subset of these properties based on the prefix.


setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Add or change the value of a property.



Copyright (c) 2000, 2001, David Walend