Classes | Public Member Functions

org.exolab.castor.xml.validators.PatternValidator Class Reference

Inheritance diagram for org.exolab.castor.xml.validators.PatternValidator:
org.exolab.castor.xml.validators.ByteValidator org.exolab.castor.xml.validators.DoubleValidator org.exolab.castor.xml.validators.FloatValidator org.exolab.castor.xml.validators.IntegerValidator org.exolab.castor.xml.validators.LongValidator org.exolab.castor.xml.validators.ShortValidator org.exolab.castor.xml.validators.StringValidator org.exolab.castor.xml.validators.NameValidator

List of all members.

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

Detailed Description

A simple abstract class used for validating types which allow the pattern facet

Author:
Keith Visco
Version:
Revision:
1.2
Date:
2004/12/11 09:13:45

Constructor & Destructor Documentation

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

Parameters:
pattern the regular expression to validate against

Member Function Documentation

String org.exolab.castor.xml.validators.PatternValidator.getPattern (  ) 

Returns the regular expression pattern for this PatternValidator, or null if no pattern has been set.

Returns:
the regular expression pattern
See also:
setPattern
boolean org.exolab.castor.xml.validators.PatternValidator.isNillable (  ) 

Returns whether or not objects validated by this Validator are nillable (are allowed to be null).

Returns:
true if null is a valid value

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).

Parameters:
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

Parameters:
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

Parameters:
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.

See also:
setPattern
Exceptions:
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().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties