ca.bc.gov.webade.preferences
Interface WebADEPreferences

All Known Implementing Classes:
DefaultWebADEPreferences

public interface WebADEPreferences

Author:
jross

Method Summary
 void addPreference(java.lang.String preferenceSubType, WebADEPreference pref)
          Adds the given WebADEPreference object to the list of preferences.
 void addPreferenceSet(java.lang.String preferenceSubType, WebADEPreferenceSet prefSet)
          Adds the given WebADEPreference object to the target set of preferences identified by the set name.
 void clear()
          Removes all preferences and preferences sets from this instance.
 java.lang.Object clone()
          see java.lang.Object#clone()
 WebADEPreference getPreference(java.lang.String preferenceSubType, java.lang.String preferenceName)
          Returns the target preference, identified by sub-type and name.
 java.util.Properties getPreferencePropertiesBySubType(java.lang.String preferenceSubType)
          Returns the preferences that match the given subtype as name value pairs in a Properties object.
 java.util.Properties getPreferencePropertiesBySubType(java.lang.String preferenceSubType, boolean convertMultiValuesToDelimitedString)
          Returns the preferences that match the given subtype as name value pairs in a Properties object.
 java.util.Properties getPreferencePropertiesBySubType(java.lang.String preferenceSubType, boolean convertMultiValuesToDelimitedString, java.lang.String delimiterString)
          Returns the preferences that match the given subtype as name value pairs in a Properties object.
 java.util.List getPreferencesBySubType(java.lang.String preferenceSubType)
          Returns the preferences that match the given subtype.
 WebADEPreferenceSet getPreferenceSet(java.lang.String preferenceSubType, java.lang.String preferenceSetName)
          Returns the target preference set.
 java.util.List getPreferenceSetsBySubType(java.lang.String preferenceSubType)
          Returns the preference sets that match the given subtype.
 java.util.List getPreferenceSubTypes()
          Returns all subtypes in the .
 WebADEPreferenceType getPreferenceType()
           
 WebADEPreferences getWebADEPreferencesBySubType(java.lang.String preferenceSubType)
          Returns the WebADEPreference and WebADEPreferenceSet objects that match the given subtype.
 void removePreference(java.lang.String preferenceSubType, java.lang.String preferenceName)
          Removes the given preference from the list of preferences.
 void removePreferenceSet(java.lang.String preferenceSubType, java.lang.String preferenceSetName)
          Removes the given preference set from the list of preference sets.
 

Method Detail

getPreferenceType

public WebADEPreferenceType getPreferenceType()
Returns:
Returns the preferenceTypeCode.

getPreferenceSubTypes

public java.util.List getPreferenceSubTypes()
Returns all subtypes in the .

Returns:
A List of WebADEPreference objects matching the sub-type.

getPreference

public WebADEPreference getPreference(java.lang.String preferenceSubType,
                                      java.lang.String preferenceName)
Returns the target preference, identified by sub-type and name.

Parameters:
preferenceSubType - The sub-type containing the preference.
preferenceName - The target preference name.
Returns:
The target WebADEPreference object, or null if not found.

getPreferencesBySubType

public java.util.List getPreferencesBySubType(java.lang.String preferenceSubType)
Returns the preferences that match the given subtype.

Parameters:
preferenceSubType - The sub-type containing the preference.
Returns:
A List of WebADEPreference objects matching the sub-type.

getPreferencePropertiesBySubType

public java.util.Properties getPreferencePropertiesBySubType(java.lang.String preferenceSubType)
                                                      throws WebADEException
Returns the preferences that match the given subtype as name value pairs in a Properties object. Assumes that all preference objects with the given subtype have at most one value assigned.

Parameters:
preferenceSubType - The sub-type containing the preference.
Returns:
A Properties object of String name-value pairs.
Throws:
WebADEException - Thrown if any of the WebADEPreference object with the given subtype have more than one value assigned.

getPreferencePropertiesBySubType

public java.util.Properties getPreferencePropertiesBySubType(java.lang.String preferenceSubType,
                                                             boolean convertMultiValuesToDelimitedString)
                                                      throws WebADEException
Returns the preferences that match the given subtype as name value pairs in a Properties object. Assumes that all preference objects with the given subtype have at most one value assigned.

Parameters:
preferenceSubType - The sub-type containing the preference.
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 with the given subtype have more than one value assigned.

getPreferencePropertiesBySubType

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

Parameters:
preferenceSubType - The sub-type containing the preference.
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 with the given subtype have more than one value assigned.

getPreferenceSet

public WebADEPreferenceSet getPreferenceSet(java.lang.String preferenceSubType,
                                            java.lang.String preferenceSetName)
Returns the target preference set. Assumes that there will be only one match for the given sub-type/set-name combination. If more than one match is found, and exception is thrown.

Parameters:
preferenceSubType - The sub-type containing the preference set.
preferenceSetName - The target preference set name.
Returns:
The target WebADEPreferenceSet object, or null if not found.

getPreferenceSetsBySubType

public java.util.List getPreferenceSetsBySubType(java.lang.String preferenceSubType)
Returns the preference sets that match the given subtype.

Parameters:
preferenceSubType - The sub-type containing the preference set.
Returns:
A List of WebADEPreferenceSet objects matching the sub-type.

getWebADEPreferencesBySubType

public WebADEPreferences getWebADEPreferencesBySubType(java.lang.String preferenceSubType)
Returns the WebADEPreference and WebADEPreferenceSet objects that match the given subtype.

Parameters:
preferenceSubType - The sub-type containing the preferences.
Returns:
A WebADEPreferences object containing all preferences and preference sets matching the sub-type.

addPreference

public void addPreference(java.lang.String preferenceSubType,
                          WebADEPreference pref)
                   throws java.lang.NullPointerException
Adds the given WebADEPreference object to the list of preferences.

Parameters:
preferenceSubType - The sub-type containing the preference.
pref - The target preference to add.
Throws:
java.lang.NullPointerException - Thrown if the preference sub type parameter was null.

removePreference

public void removePreference(java.lang.String preferenceSubType,
                             java.lang.String preferenceName)
Removes the given preference from the list of preferences.

Parameters:
preferenceSubType - The sub-type containing the preference.
preferenceName - The name of the target preference.

addPreferenceSet

public void addPreferenceSet(java.lang.String preferenceSubType,
                             WebADEPreferenceSet prefSet)
                      throws java.lang.NullPointerException
Adds the given WebADEPreference object to the target set of preferences identified by the set name.

Parameters:
preferenceSubType - The sub-type containing the preference.
prefSet - The target preference set to add.
Throws:
java.lang.NullPointerException - Thrown if the preference sub type parameter was null.

removePreferenceSet

public void removePreferenceSet(java.lang.String preferenceSubType,
                                java.lang.String preferenceSetName)
Removes the given preference set from the list of preference sets.

Parameters:
preferenceSubType - The sub-type containing the preference set.
preferenceSetName - The name of the target preference set.

clear

public void clear()
Removes all preferences and preferences sets from this instance.


clone

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