org.exolab.castor.xml.validators
public class NameValidator extends StringValidator
Modifier and Type | Field and Description |
---|---|
static short |
CDATA
XML name type CDATA.
|
static short |
NCNAME
XML name type NCName.
|
static short |
NMTOKEN
XML name type NMTOKEN.
|
resourceBundle
Constructor and Description |
---|
NameValidator()
Creates a new NameValidator with the default validation set to NCName.
|
NameValidator(short type)
Creates a new NameValidator with the given validation type.
|
Modifier and Type | Method and Description |
---|---|
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.Object object,
ValidationContext context)
Validates the given Object.
|
void |
validate(java.lang.String value,
ValidationContext context)
Validates the given Object.
|
clearFixed, normalize, setFixed, setFixedValue, setLength, setMaxLength, setMinLength, setWhiteSpace
addPattern, clearPatterns, getPatterns, hasPattern, isNillable, setNillable
public static final short NCNAME
public static final short NMTOKEN
public static final short CDATA
public NameValidator()
public NameValidator(short type)
type
- the validation type for this NameValidatorpublic void setRequired(boolean required)
setRequired
in class StringValidator
required
- the flag indicating whether Strings are requiredpublic void validate(java.lang.String value, ValidationContext context) throws ValidationException
validate
in class StringValidator
value
- the string to validatecontext
- the ValidationContextValidationException
- if the object fails validation.#setPattern
public void validate(java.lang.Object object) throws ValidationException
validate
in class StringValidator
object
- the Object to validateValidationException
- if the object fails validation.public void validate(java.lang.Object object, ValidationContext context) throws ValidationException
validate
in interface TypeValidator
validate
in class StringValidator
object
- the Object to validatecontext
- the ValidationContextValidationException
- if the object fails validation.Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com