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

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
All Implemented Interfaces:
Condition
Direct Known Subclasses:
ContainsSubstringStringCondition, EqualsIgnoreCaseStringCondition, LengthRangeStringCondition, MaxLengthStringCondition, MinLengthStringCondition, RegExpStringCondition

public abstract class AbstractStringCondition
extends NonNullAcceptingTypeSpecificCondition

An abstract condition that can be applied on objects of type String.

Author:
Uri Boness

Field Summary
protected static String EMPTY_STRING
           
 
Constructor Summary
protected AbstractStringCondition()
          Constructs a new AbstractStringCondition.
 
Method Summary
protected abstract  boolean checkString(String text)
          Checks whether the given string adheres to this condition.
 boolean doCheck(Object object)
          See Condition.check(Object)
 
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
 

Field Detail

EMPTY_STRING

protected static final String EMPTY_STRING
See Also:
Constant Field Values
Constructor Detail

AbstractStringCondition

protected AbstractStringCondition()
Constructs a new AbstractStringCondition.

Method Detail

doCheck

public final boolean doCheck(Object object)
See Condition.check(Object)

Specified by:
doCheck in class AbstractCondition
Parameters:
object - The object to be checked.
Returns:
true if the given object adheres to this condition, false otherwise.
Throws:
IllegalArgumentException - if the given object is either null or not of a java.lang.String type.

checkString

protected abstract boolean checkString(String text)
Checks whether the given string adheres to this condition.

Parameters:
text - The string to be checked.
Returns:
true if the given string adheres to this condition, false otherwise.


Copyright © 2009. All Rights Reserved.