ca.bc.gov.webade.validation
Class PreferencesValidator

java.lang.Object
  extended byca.bc.gov.webade.validation.PreferencesValidator

public final class PreferencesValidator
extends java.lang.Object

Author:
jross

Field Summary
static java.lang.String WILDCARD
          Preference type, sub-type, set-name, and name can be set to the WILDCARD value to allow that part of the preference key to be ignored when looking for preference validators assigned to Preference objects that match the target preference.
 
Constructor Summary
PreferencesValidator()
           
 
Method Summary
 void addPreferenceSetValidator(PreferenceSet set, PreferenceSetValidator validator)
          Adds the given validator tied to the target preference set to the set of preference set validators.
 void addPreferenceValidator(Preference pref, PreferenceValidator validator)
          Adds the given validator tied to the target preference to the set of preference validators.
 java.lang.String[] validatePreferences(Preferences prefs)
          Validates the given Preferences object, returning a set of validation errors for misconfigured preferences.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WILDCARD

public static final java.lang.String WILDCARD
Preference type, sub-type, set-name, and name can be set to the WILDCARD value to allow that part of the preference key to be ignored when looking for preference validators assigned to Preference objects that match the target preference.

See Also:
Constant Field Values
Constructor Detail

PreferencesValidator

public PreferencesValidator()
Method Detail

validatePreferences

public java.lang.String[] validatePreferences(Preferences prefs)
Validates the given Preferences object, returning a set of validation errors for misconfigured preferences.

Parameters:
prefs - The preferences object.
Returns:
An array or error messages.

addPreferenceValidator

public void addPreferenceValidator(Preference pref,
                                   PreferenceValidator validator)
Adds the given validator tied to the target preference to the set of preference validators.

Parameters:
pref - The preference the validator is assigned to.
validator - The preference validator.

addPreferenceSetValidator

public void addPreferenceSetValidator(PreferenceSet set,
                                      PreferenceSetValidator validator)
Adds the given validator tied to the target preference set to the set of preference set validators.

Parameters:
set - The preference set the validator is assigned to.
validator - The preference set validator.