org.springmodules.validation.util.condition.string
Class RegExpStringCondition
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.RegExpStringCondition
- All Implemented Interfaces: 
 - Condition
 
- Direct Known Subclasses: 
 - EmailStringCondition
 
public class RegExpStringCondition
- extends AbstractStringCondition
 
An AbstractStringCondition implementation that checks whether the checked strings match a specific regular
 expression.
- Author:
 
  - Uri Boness
 
 
 
| 
Constructor Summary | 
RegExpStringCondition(Pattern pattern)
 
          Constructs a new RegExpStringCondition with a given Pattern that the checked text will be checked
 against. | 
RegExpStringCondition(String regexp)
 
          Constructs a new RegExpStringCondition with a given regular expression that the checkCalendar text will be checked
 against. | 
 
| 
Method Summary | 
protected  boolean | 
checkString(String text)
 
          Checks whether the given text matches the regular expression that is associated with this condition. | 
 Pattern | 
getPattern()
 
          Returns the pattern that is associated with this condition. | 
 String | 
getRegExp()
 
          Returns the regular expression that is associated with this condition. | 
 
 
 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
RegExpStringCondition
public RegExpStringCondition(String regexp)
- Constructs a new RegExpStringCondition with a given regular expression that the checkCalendar text will be checked
 against.
- Parameters:
 regexp - The given regular expression.
 
RegExpStringCondition
public RegExpStringCondition(Pattern pattern)
- Constructs a new RegExpStringCondition with a given 
Pattern that the checked text will be checked
 against.
- Parameters:
 pattern - The pattern that the checked text will be checked against.
 
checkString
protected boolean checkString(String text)
- Checks whether the given text matches the regular expression that is associated with this condition.
- Specified by:
 checkString in class AbstractStringCondition
 
- Parameters:
 text - The text to be checked.
- Returns:
 true if the given text matches the regular expression that is associated with this
         condition, false otherwise.
 
 
getPattern
public Pattern getPattern()
- Returns the pattern that is associated with this condition.
- Returns:
 - The pattern that is associated with this condition.
 
 
 
getRegExp
public String getRegExp()
- Returns the regular expression that is associated with this condition.
- Returns:
 - The regular expression that is associated with this condition.
 
 
 
Copyright © 2009. All Rights Reserved.