com.ail.core.configure
Interface Configure

All Known Implementing Classes:
Core

public interface Configure

This interface describes the methods that the Core is expected to expose for clients to access configuration settings, and which this package supports.

This interface is one half of a pair, the other being ConfigurationOwner. Client code (code using the core) would be expected to use the interface described here to access the values of their settings. They should use ConfigurationOwner to access the configuration settings as a whole, and to make changes to settings.

Version:
$Revision: 1.2 $

Method Summary
 Group getGroup(java.lang.String name)
          Retrieve a specific group by name.
 Parameter getParameter(java.lang.String name)
          Retrieve a specific paramater by name.
 java.util.Properties getParametersAsProperties(java.lang.String name)
          Retrieve a group of Parameters as Properties.
 java.lang.String getParameterValue(java.lang.String name)
          Get the value of a parameter by name.
 java.lang.String getParameterValue(java.lang.String name, java.lang.String defaultValue)
          Return the value of a parameter or a default value if the parameter is undefined.
 

Method Detail

getParameter

Parameter getParameter(java.lang.String name)
Retrieve a specific paramater by name. The name may be dot seperated to drill down through nested groups.

Parameters:
name - Parameter name.
Returns:
The parameter associated with the name, or null if the parameter is not defined.

getParameterValue

java.lang.String getParameterValue(java.lang.String name)
Get the value of a parameter by name. The name may be dot seperated to drill down through nested goups. The following two bits of code are exactly equivalent with the exception that the second will not fail with a NullPointerException is "parameterName" is undefined:
String x=getParameter("parameterName").getValue();
String x=getParameterValue("parameterName");

Parameters:
name - Name of the parameter to fetch the value for
Returns:
Value of the parameter, or null if it is undefined.

getParameterValue

java.lang.String getParameterValue(java.lang.String name,
                                   java.lang.String defaultValue)
Return the value of a parameter or a default value if the parameter is undefined.

Parameters:
name - Name of the parameter to return the value of.
defaultValue - If the parameter is undefined return this instead
Returns:
The value of the parameter, of default if it is undefined.

getGroup

Group getGroup(java.lang.String name)
Retrieve a specific group by name. The name may be dot seperated to drill down through nested groups.

Parameters:
name - The group's name.
Returns:
The located group, .

getParametersAsProperties

java.util.Properties getParametersAsProperties(java.lang.String name)
Retrieve a group of Parameters as Properties. This is a utility method which returns the Parameters found in a Group as a java.util.Properties.

Parameters:
name - The name of the group to convert.
Returns:
The Parameters in the group as Properties