}
char[] pwd = clearTextPassword.toCharArray();
if ( minPasswordLength > 0 && pwd.length < minPasswordLength )
{
throw new InvalidPasswordException();
}
if ( minNumberOfDigits > 0)
{
for ( int i = 0; i < pwd.length; i++ )
{
if (Character.isDigit(pwd[i]))
{
digits++;
}
}
if (digits < minNumberOfDigits)
{
throw new InvalidPasswordException();
}
}
}