public class StringValidator extends PatternValidator implements TypeValidator
PatternValidator.DefaultRegExpEvaluator| Constructor and Description |
|---|
StringValidator()
Creates a new StringValidator with no restrictions
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
normalize(java.lang.String value)
NOTE: THIS METHOD SHOULD NOT BE HERE..SHOULD BE MOVED
TO A FieldHandler or to the Unmarshaller...but not
here!!! (kvisco 20030125)
Normalizes the given string according to the whiteSpace
facet used
|
void |
setFixed(java.lang.String fixedValue)
Sets the fixed value in which all valid Strings must match.
|
void |
setFixedValue(java.lang.String fixedValue)
Deprecated.
since 0.9.4_beta
|
void |
setLength(int length)
Sets the length that valid Strings must be
|
void |
setMaxLength(int maxLength)
Sets the maximum length of that a valid String must be.
|
void |
setMinLength(int minLength)
Sets the minimum length that valid Strings must be
|
void |
setRequired(boolean required)
Sets whether or not a String is required (non null)
|
void |
setWhiteSpace(java.lang.String value)
Sets the whiteSpace facet of the validator
|
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.
|
getPattern, hasPattern, isNillable, setNillable, setPatternpublic StringValidator()
public void setFixed(java.lang.String fixedValue)
fixedValue - the fixed value that all Strings must matchpublic void setFixedValue(java.lang.String fixedValue)
public void setMaxLength(int maxLength)
maxLength - the maximum length for valid Stringspublic void setMinLength(int minLength)
minLength - the minimum length that valid Strings must bepublic void setLength(int length)
length - the length that valid Strings must bepublic void setRequired(boolean required)
required - the flag indicating whether Strings are requiredpublic void setWhiteSpace(java.lang.String value)
Sets the whiteSpace facet of the validator
The value of the whiteSpace facet must be one of the following:
value - the whiteSpace valuepublic java.lang.String normalize(java.lang.String value)
value - the String to normalizepublic void validate(java.lang.String value,
ValidationContext context)
throws ValidationException
PatternValidatorvalidate in class PatternValidatorValidationException - 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
object - the Object to validateValidationExceptionpublic void validate(java.lang.Object object,
ValidationContext context)
throws ValidationException
validate in interface TypeValidatorvalidate in class PatternValidatorobject - the Object to validatecontext - the ValidationContextValidationExceptionIntalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com