Class IdValidator
java.lang.Object
org.exolab.castor.xml.validators.PatternValidator
org.exolab.castor.xml.validators.StringValidator
org.exolab.castor.xml.validators.IdValidator
- All Implemented Interfaces:
TypeValidator
The ID Validation class.
- Version:
- $Revision: 5951 $ $Date: 2003-03-03 02:57:21 -0700 (Mon, 03 Mar 2003) $
- Author:
- Werner Guttman
-
Field Summary
Fields inherited from class PatternValidator
resourceBundle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidValidates the given Object.voidvalidate(Object object, ValidationContext context) Validates the given Object.voidvalidate(String value, ValidationContext context) Validates the given Object.Methods inherited from class StringValidator
clearFixed, normalize, setFixed, setFixedValue, setLength, setMaxLength, setMinLength, setRequired, setWhiteSpaceModifier and TypeMethodDescriptionvoidClears the fixed value for this ShortValidator.Normalizes the given string according to the whiteSpace facet used.voidSets the fixed value in which all valid Strings must match.voidsetFixedValue(String fixedValue) Deprecated.since 0.9.4_betavoidsetLength(int length) Sets the required string length for String validation.voidsetMaxLength(int maxLength) Sets the maximum string length for String validation.voidsetMinLength(int minLength) Sets the minimum string length for String validation.voidsetRequired(boolean required) Sets whether or not a String is required (non null).voidsetWhiteSpace(String value) Sets the whiteSpace facet of the validator.Methods inherited from class PatternValidator
addPattern, clearPatterns, getPatterns, hasPattern, isNillable, setNillableModifier and TypeMethodDescriptionvoidaddPattern(String pattern) Sets the regular expression to validate against.voidClear all configured patterns.Returns the collection of regular expression patterns.booleanReturns true if a regular expression has been set for this PatternValidator.booleanReturns whether or not objects validated by this Validator are nillable (are allowed to be null).voidsetNillable(boolean nillable) Sets whether or not objects validated by this Validator are allowed to be null (nillable).
-
Constructor Details
-
IdValidator
public IdValidator()Creates a new IdValidator with no restrictions.
-
-
Method Details
-
validate
Validates the given Object.- Overrides:
validatein classStringValidator- Parameters:
value- the string to validatecontext- the ValidationContext- Throws:
ValidationException- if the object fails validation.- See Also:
-
validate
Validates the given Object.- Overrides:
validatein classStringValidator- Parameters:
object- the Object to validate- Throws:
ValidationException- if the object fails validation.
-
validate
Validates the given Object.- Specified by:
validatein interfaceTypeValidator- Overrides:
validatein classStringValidator- Parameters:
object- the Object to validatecontext- the ValidationContext- Throws:
ValidationException- if the object fails validation.
-