org.formaria.validation
Class PasswordValidator

java.lang.Object
  extended by org.formaria.aria.validation.AbstractValidator
      extended by org.formaria.validation.PasswordValidator
All Implemented Interfaces:
Validator

public class PasswordValidator
extends AbstractValidator

Validates names, by ensuring they are properly formed, of adequate length and containing a valid set of characters. A password must be at least 6 characters excluding spaces. A strong password must also include at least one space and one number or non alphanumeric in addition to the 6 character requirement for a normal password.

Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from formaria.

$Revision: 1.8 $


Field Summary
 
Fields inherited from class org.formaria.aria.validation.AbstractValidator
container, currentProject, errorLevel, formattedMessage, mandatory, mask, message, showErrorBadges, start, translator, USE_FAIL_STYLE, USE_NORMAL_STYLE, USE_WARN_STYLE, validationMethod, validationName, value
 
Fields inherited from interface org.formaria.aria.validation.Validator
IGNORE_BLANKS, LEVEL_ERROR, LEVEL_IGNORE, LEVEL_WARNING, MANDATORY, STRICT_CHECK, WEAK_CHECK
 
Constructor Summary
PasswordValidator(Project project)
          Validates a password.
 
Method Summary
 void setup(XmlElement ruleConfig, XmlElement instanceConfig)
          Set the validation parameters
 void validate(java.lang.Object comp, boolean forceMandatory)
          Does the checking of the password
 
Methods inherited from class org.formaria.aria.validation.AbstractValidator
applyErrorStyle, getLevel, getMask, getMessage, getName, getText, getValueAsString, invokeMethod, replaceToken, replaceTokens, setMask, setName, setValidationColors, setValidationMethod, throwException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PasswordValidator

public PasswordValidator(Project project)
Validates a password.

Parameters:
isStrong - true if this is to be a strong password
msg - The message to be displayed if validation fails
Method Detail

setup

public void setup(XmlElement ruleConfig,
                  XmlElement instanceConfig)
Set the validation parameters

Specified by:
setup in interface Validator
Overrides:
setup in class AbstractValidator
Parameters:
ruleConfig - the validator parameters as declared in the validations rules file
instanceConfig - the validator instance parameters as declared in the page file

validate

public void validate(java.lang.Object comp,
                     boolean forceMandatory)
              throws java.lang.Exception
Does the checking of the password

Parameters:
comp - The component triggering the validation
forceMandatory - Set to true if page level validations are taking place or false for inline
Throws:
java.lang.Exception - Contains the details of the message