Arch4J 1.1

org.arch4j.property
Interface PropertyManager

All Known Implementing Classes:
PropertyManagerImpl, XMLPropertyManager

public interface PropertyManager

This interface defines the methods that a simple property file manager needs to implement. Properties are thought of as belonging to a domain. The domain is the name of the properties file without the .properties extension.

Version:
2.1
Author:
Russ Brown, Ross E. Greinke

Method Summary
 Properties getProperties(String forDomain)
          Returns all the Properties associated with a given domain.
 String getProperty(String forDomain, String propertyName)
          Searches for the property with the specified property name within the given domain.
 String getProperty(String forDomain, String propertyName, String defaultValue)
          Searches for the property with the specified property name within the given domain.
 File getPropertyDirectory()
          Returns the property directory where property files are stored.
 void setProperty(String forDomain, String propertyName, String propertyValue)
          This method sets the given property for a said domain Each time setProperty is called it writes to the file and refreshes the cache If the entry exists the value is changed otherwise a new value is added.
 

Method Detail

getPropertyDirectory

public File getPropertyDirectory()
Returns the property directory where property files are stored.

Returns:
The property directory as a File.

getProperties

public Properties getProperties(String forDomain)
Returns all the Properties associated with a given domain.

Parameters:
forDomain - The domain name.
Returns:
The properties associated with domain.

getProperty

public String getProperty(String forDomain,
                          String propertyName)
Searches for the property with the specified property name within the given domain. The method returns null if the property is not found.

Parameters:
forDomain - The domain name.
propertyName - The key to search for.
Returns:
The property value for the property name (key) or null.

setProperty

public void setProperty(String forDomain,
                        String propertyName,
                        String propertyValue)
This method sets the given property for a said domain Each time setProperty is called it writes to the file and refreshes the cache If the entry exists the value is changed otherwise a new value is added.

Parameters:
forDomain - The domain name.
propertyName - The key to search for.
propertyValue - The new value for the property name (key) or null.

getProperty

public String getProperty(String forDomain,
                          String propertyName,
                          String defaultValue)
Searches for the property with the specified property name within the given domain. The method returns the default value if the property is not found.

Parameters:
forDomain - The domain name.
propertyName - The key to search for.
defaultValue - The value to return if the property key is not found.
Returns:
The property value for the property name (key) or the default value.

Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.