ca.bc.gov.webade.preferences
Interface WebADEPreferenceSet

All Known Implementing Classes:
DefaultWebADEPreferenceSet

public interface WebADEPreferenceSet

Author:
jross

Method Summary
 void addPreference(WebADEPreference preference)
          Adds the given preference to the current set, removing the previous one, if found.
 void clearPreferences()
          Removes all preferences from the current set.
 java.lang.Object clone()
          see java.lang.Object#clone()
 WebADEPreference getPreference(java.lang.String preferenceName)
          Returns the corresponding value for the given preference name, or null if not found.
 java.util.List getPreferenceNames()
          Returns the preference names of the preference set.
 java.util.Properties getPreferenceProperties(boolean convertMultiValuesToDelimitedString)
          Returns all preferences in the set as name value pairs in a Properties object.
 java.util.Properties getPreferenceProperties(boolean convertMultiValuesToDelimitedString, java.lang.String delimiterString)
          Returns all preferences in the set as name value pairs in a Properties object.
 java.util.List getPreferences()
          Returns the set of preferences.
 java.lang.String getPreferenceSetName()
           
 java.util.Properties getPreferencesProperties()
          Returns all preferences in the set as name value pairs in a Properties object.
 void removePreference(java.lang.String preferenceName)
          Removes the given preference from the current set.
 

Method Detail

getPreferenceSetName

public java.lang.String getPreferenceSetName()
Returns:
Returns the name.

getPreferences

public java.util.List getPreferences()
Returns the set of preferences.

Returns:
An ArrayList of WebADEPreference objects.

getPreferenceNames

public java.util.List getPreferenceNames()
Returns the preference names of the preference set.

Returns:
An ArrayList of String objects.

getPreference

public WebADEPreference getPreference(java.lang.String preferenceName)
Returns the corresponding value for the given preference name, or null if not found.

Parameters:
preferenceName - The unique name of the target preference in the set.
Returns:
A String value.

getPreferencesProperties

public java.util.Properties getPreferencesProperties()
                                              throws WebADEException
Returns all preferences in the set as name value pairs in a Properties object. Assumes that all preference objects in the set have at most one value assigned.

Returns:
A Properties object of String name-value pairs.
Throws:
WebADEException - Thrown if any of the WebADEPreference object within the set have more than one value assigned.

getPreferenceProperties

public java.util.Properties getPreferenceProperties(boolean convertMultiValuesToDelimitedString)
                                             throws WebADEException
Returns all preferences in the set as name value pairs in a Properties object. Assumes that all preference objects in the set have at most one value assigned.

Parameters:
convertMultiValuesToDelimitedString - Flag to convert multi-value preferences to a single comma-delimited value in the properties file (if set to true), or whether to throw an exception (if set to false).
Returns:
A Properties object of String name-value pairs.
Throws:
WebADEException - Thrown if any of the WebADEPreference object within the set have more than one value assigned, unless the convertMultiValuesToDelimitedString is set to true.

getPreferenceProperties

public java.util.Properties getPreferenceProperties(boolean convertMultiValuesToDelimitedString,
                                                    java.lang.String delimiterString)
                                             throws WebADEException
Returns all preferences in the set as name value pairs in a Properties object. Assumes that all preference objects in the set have at most one value assigned.

Parameters:
convertMultiValuesToDelimitedString - Flag to convert multi-value preferences to a single delimited value in the properties file (if set to true), or whether to throw an exception (if set to false).
delimiterString - The string used to delimit the multi-values string. The default value is a comma.
Returns:
A Properties object of String name-value pairs.
Throws:
WebADEException - Thrown if any of the WebADEPreference object within the set have more than one value assigned, unless the convertMultiValuesToDelimitedString is set to true.

addPreference

public void addPreference(WebADEPreference preference)
Adds the given preference to the current set, removing the previous one, if found.

Parameters:
preference - The target preference.

removePreference

public void removePreference(java.lang.String preferenceName)
Removes the given preference from the current set.

Parameters:
preferenceName - The name of the target preference.

clearPreferences

public void clearPreferences()
Removes all preferences from the current set.


clone

public java.lang.Object clone()
see java.lang.Object#clone()