Classes | |
class | DefaultRegExpEvaluator |
Public Member Functions | |
PatternValidator () | |
PatternValidator (String pattern) | |
String | getPattern () |
boolean | isNillable () |
boolean | hasPattern () |
void | setNillable (boolean nillable) |
void | setPattern (String pattern) |
void | validate (String str, ValidationContext context) throws ValidationException |
void | validate (Object object, ValidationContext context) throws ValidationException |
A simple abstract class used for validating types which allow the pattern facet
org.exolab.castor.xml.validators.PatternValidator.PatternValidator | ( | ) |
Creates a new PatternValidator with no default regular expression
org.exolab.castor.xml.validators.PatternValidator.PatternValidator | ( | String | pattern | ) |
Creates a new PatternValidator with the given regular expresion
pattern | the regular expression to validate against |
String org.exolab.castor.xml.validators.PatternValidator.getPattern | ( | ) |
Returns the regular expression pattern for this PatternValidator, or null if no pattern has been set.
boolean org.exolab.castor.xml.validators.PatternValidator.hasPattern | ( | ) |
Returns true if a regular expression has been set for this PatternValidator
Referenced by org.exolab.castor.xml.validators.StringValidator.validate(), org.exolab.castor.xml.validators.ShortValidator.validate(), org.exolab.castor.xml.validators.LongValidator.validate(), org.exolab.castor.xml.validators.IntegerValidator.validate(), org.exolab.castor.xml.validators.FloatValidator.validate(), org.exolab.castor.xml.validators.DoubleValidator.validate(), and org.exolab.castor.xml.validators.ByteValidator.validate().
boolean org.exolab.castor.xml.validators.PatternValidator.isNillable | ( | ) |
Returns whether or not objects validated by this Validator are nillable (are allowed to be null).
Referenced by org.exolab.castor.xml.validators.StringValidator.validate().
void org.exolab.castor.xml.validators.PatternValidator.setNillable | ( | boolean | nillable | ) |
Sets whether or not objects validated by this Validator are allowed to be null (nillable).
nillable | a boolean that when true indicates null values pass validation |
void org.exolab.castor.xml.validators.PatternValidator.setPattern | ( | String | pattern | ) |
Sets the regular expression to validate against
pattern | the regular expression to use when validating |
References org.exolab.castor.util.RegExpEvaluator.setExpression().
void org.exolab.castor.xml.validators.PatternValidator.validate | ( | Object | object, | |
ValidationContext | context | |||
) | throws ValidationException |
Validates the given Object
object | the Object to validate | |
context | the ValidationContext |
References org.exolab.castor.xml.validators.PatternValidator.validate().
void org.exolab.castor.xml.validators.PatternValidator.validate | ( | String | str, | |
ValidationContext | context | |||
) | throws ValidationException |
Validates the given String against the regular expression pattern of this PatternValidator.
ValidationException | if the given String is not matched by the regular expression pattern |
References org.exolab.castor.util.RegExpEvaluator.matches().
Referenced by org.exolab.castor.xml.validators.PatternValidator.validate().