org.exolab.castor.xml.validators
Class NameValidator
java.lang.Object
org.exolab.castor.xml.validators.PatternValidator
org.exolab.castor.xml.validators.StringValidator
org.exolab.castor.xml.validators.NameValidator
- All Implemented Interfaces:
- TypeValidator
- public class NameValidator
- extends StringValidator
The Name Validation class. This class handles validation
for XML Name production types such as NCName and NMToken
- Version:
- $Revision: 1.5 $ $Date: 2001/08/31 13:18:58 $
- Author:
- Keith Visco
Constructor Summary |
NameValidator()
Creates a new NameValidator with the default validation
set to NCName |
NameValidator(short type)
Creates a new NameValidator with the given validation type |
Method Summary |
void |
setRequired(boolean required)
Sets whether or not a String is required (non null) |
void |
validate(java.lang.Object object)
Validates the given Object |
void |
validate(java.lang.String value)
Validates the given String against the regular expression pattern
of this PatternValidator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NCNAME
public static final short NCNAME
- See Also:
- Constant Field Values
NMTOKEN
public static final short NMTOKEN
- See Also:
- Constant Field Values
CDATA
public static final short CDATA
- See Also:
- Constant Field Values
NameValidator
public NameValidator()
- Creates a new NameValidator with the default validation
set to NCName
NameValidator
public NameValidator(short type)
- Creates a new NameValidator with the given validation type
- Parameters:
type
- the validation type for this NameValidator
setRequired
public void setRequired(boolean required)
- Sets whether or not a String is required (non null)
- Overrides:
setRequired
in class StringValidator
- Parameters:
required
- the flag indicating whether Strings are required
validate
public void validate(java.lang.String value)
throws ValidationException
- Description copied from class:
PatternValidator
- Validates the given String against the regular expression pattern
of this PatternValidator.
- Overrides:
validate
in class StringValidator
- Throws:
ValidationException
validate
public void validate(java.lang.Object object)
throws ValidationException
- Validates the given Object
- Specified by:
validate
in interface TypeValidator
- Overrides:
validate
in class StringValidator
- Parameters:
object
- the Object to validate
- Throws:
ValidationException
Intalio Inc. (C) 1999-2001. All rights reserved http://www.intalio.com