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(Object object)
Validates the given Object.
|
void |
validate(Object object,
ValidationContext context)
Validates the given Object.
|
void |
validate(String value,
ValidationContext context)
Validates the given Object.
|
clearFixed, normalize, setFixed, setFixedValue, setLength, setMaxLength, setMinLength, setWhiteSpaceaddPattern, clearPatterns, getPatterns, hasPattern, isNillable, setNillablepublic 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 StringValidatorrequired - the flag indicating whether Strings are requiredpublic void validate(String value, ValidationContext context) throws ValidationException
validate in class StringValidatorvalue - the string to validatecontext - the ValidationContextValidationException - if the object fails validation.#setPatternpublic void validate(Object object) throws ValidationException
validate in class StringValidatorobject - the Object to validateValidationException - if the object fails validation.public void validate(Object object, ValidationContext context) throws ValidationException
validate in interface TypeValidatorvalidate in class StringValidatorobject - the Object to validatecontext - the ValidationContextValidationException - if the object fails validation.Copyright © 2016. All rights reserved.