org.springmodules.validation.util.condition.string
Class MaxLengthStringCondition
java.lang.Object
org.springmodules.validation.util.condition.AbstractCondition
org.springmodules.validation.util.condition.TypeSpecificCondition
org.springmodules.validation.util.condition.NonNullAcceptingTypeSpecificCondition
org.springmodules.validation.util.condition.string.AbstractStringCondition
org.springmodules.validation.util.condition.string.MaxLengthStringCondition
- All Implemented Interfaces:
- Condition
public class MaxLengthStringCondition
- extends AbstractStringCondition
An AbstractStringCondition
implementation that checks whether the checked strings are not longer then
a specific length.
- Author:
- Uri Boness
Constructor Summary |
MaxLengthStringCondition(int maxLength)
Creates a new MaxLengthStringCondition with a given maximum length. |
Method Summary |
protected boolean |
checkString(String text)
Checks whether the given text is not longer than the maximum length that is associated with this condition. |
int |
getMaxLength()
Returns the maximum length that is associated with this condition. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MaxLengthStringCondition
public MaxLengthStringCondition(int maxLength)
- Creates a new MaxLengthStringCondition with a given maximum length.
- Parameters:
maxLength
- The maximum length the checked string will be checked against.
checkString
protected boolean checkString(String text)
- Checks whether the given text is not longer than the maximum 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 longer than the maximum length associated with this condition,
false
otherwise.
getMaxLength
public int getMaxLength()
- Returns the maximum length that is associated with this condition.
- Returns:
- The maximum length that is associated with this condition.
Copyright © 2009. All Rights Reserved.