org.springmodules.validation.util.condition.string
Class MinLengthStringCondition

java.lang.Object
  extended by org.springmodules.validation.util.condition.AbstractCondition
      extended by org.springmodules.validation.util.condition.TypeSpecificCondition
          extended by org.springmodules.validation.util.condition.NonNullAcceptingTypeSpecificCondition
              extended by org.springmodules.validation.util.condition.string.AbstractStringCondition
                  extended by org.springmodules.validation.util.condition.string.MinLengthStringCondition
All Implemented Interfaces:
Condition

public class MinLengthStringCondition
extends AbstractStringCondition

An AbstractStringCondition implementation that checks whether the checked strings are not shorter than a specific minimum length.

Author:
Uri Boness

Field Summary
 
Fields inherited from class org.springmodules.validation.util.condition.string.AbstractStringCondition
EMPTY_STRING
 
Constructor Summary
MinLengthStringCondition(int minLength)
          Creates a new MinLengthStringCondition with a given minimum length that the checked strings will be checked against.
 
Method Summary
protected  boolean checkString(String text)
          Checks whether the given text is not shorter then the minimum length that is associated with this condition.
 int getMinLength()
          Returns the minimum length that is associated with this condition.
 
Methods inherited from class org.springmodules.validation.util.condition.string.AbstractStringCondition
doCheck
 
Methods inherited from class org.springmodules.validation.util.condition.NonNullAcceptingTypeSpecificCondition
beforeObjectChecked
 
Methods inherited from class org.springmodules.validation.util.condition.AbstractCondition
afterObjectChecked, and, check, or
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinLengthStringCondition

public MinLengthStringCondition(int minLength)
Creates a new MinLengthStringCondition with a given minimum length that the checked strings will be checked against.

Parameters:
minLength - The minimum length that the checked strings will be checked against.
Method Detail

checkString

protected boolean checkString(String text)
Checks whether the given text is not shorter then the minimum length that is associated with this condition.

Specified by:
checkString in class AbstractStringCondition
Parameters:
text - The checked text.
Returns:
true if the given text is not shorter then the minimum length that is associated with this condition, false otherwise.

getMinLength

public int getMinLength()
Returns the minimum length that is associated with this condition.

Returns:
The minimum length that is associated with this condition.


Copyright © 2009. All Rights Reserved.