org.exolab.castor.xml.validators

Class NameValidator

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.2 $ $Date: 2003/03/03 09:57:21 $

Author: Keith Visco

Field Summary
static shortCDATA
static shortNCNAME
static shortNMTOKEN
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
voidsetRequired(boolean required)
Sets whether or not a String is required (non null)
voidvalidate(String value, ValidationContext context)
voidvalidate(Object object)
Validates the given Object
voidvalidate(Object object, ValidationContext context)
Validates the given Object

Field Detail

CDATA

public static final short CDATA

NCNAME

public static final short NCNAME

NMTOKEN

public static final short NMTOKEN

Constructor Detail

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

Method Detail

setRequired

public void setRequired(boolean required)
Sets whether or not a String is required (non null)

Parameters: required the flag indicating whether Strings are required

validate

public void validate(String value, ValidationContext context)

validate

public void validate(Object object)
Validates the given Object

Parameters: object the Object to validate

validate

public void validate(Object object, ValidationContext context)
Validates the given Object

Parameters: object the Object to validate context the ValidationContext

Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com