|
||||||||
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
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.exolab.castor.xml.validators.PatternValidator |
---|
PatternValidator.DefaultRegExpEvaluator |
Field Summary | |
---|---|
static short |
CDATA
|
static short |
NCNAME
|
static short |
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 String against the regular expression pattern of this PatternValidator. |
Methods inherited from class org.exolab.castor.xml.validators.StringValidator |
---|
normalize, setFixed, setFixedValue, setLength, setMaxLength, setMinLength, setWhiteSpace |
Methods inherited from class org.exolab.castor.xml.validators.PatternValidator |
---|
getPattern, hasPattern, isNillable, setNillable, setPattern |
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
PatternValidator
validate
in class StringValidator
ValidationException
- if the given String is not
matched by the regular expression patternPatternValidator.setPattern(java.lang.String)
public void validate(java.lang.Object object) throws ValidationException
validate
in class StringValidator
object
- the Object to validate
ValidationException
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
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |