|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.xml.validators.PatternValidator
org.exolab.castor.xml.validators.StringValidator
org.exolab.castor.xml.validators.NameValidator
public class NameValidator
The Name Validation class. This class handles validation for XML Name production types such as NCName and NMToken
Field Summary | |
---|---|
static short |
CDATA
XML name type CDATA. |
static short |
NCNAME
XML name type NCName. |
static short |
NMTOKEN
XML name type NMTOKEN. |
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.Object object,
ValidationContext context)
Validates the given Object. |
void |
validate(java.lang.String value,
ValidationContext context)
Validates the given Object. |
Methods inherited from class org.exolab.castor.xml.validators.StringValidator |
---|
clearFixed, normalize, setFixed, setFixedValue, setLength, setMaxLength, setMinLength, setWhiteSpace |
Methods inherited from class org.exolab.castor.xml.validators.PatternValidator |
---|
addPattern, clearPatterns, getPatterns, hasPattern, isNillable, setNillable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short NCNAME
public static final short NMTOKEN
public static final short CDATA
Constructor Detail |
---|
public NameValidator()
public NameValidator(short type)
type
- the validation type for this NameValidatorMethod Detail |
---|
public 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 ValidationContext
ValidationException
- if the object fails validation.#setPattern
public void validate(java.lang.Object object) throws ValidationException
validate
in class StringValidator
object
- the Object to validate
ValidationException
- 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 ValidationContext
ValidationException
- if the object fails validation.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |