|
||||||||||
| 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
public class StringValidator
The String Validation class.
| Constructor Summary | |
|---|---|
StringValidator()
Creates a new StringValidator with no restrictions. |
|
| Method Summary | |
|---|---|
void |
clearFixed()
Clears the fixed value for this ShortValidator. |
String |
normalize(String value)
Normalizes the given string according to the whiteSpace facet used. |
void |
setFixed(String fixedValue)
Sets the fixed value in which all valid Strings must match. |
void |
setFixedValue(String fixedValue)
Deprecated. since 0.9.4_beta |
void |
setLength(int length)
Sets the required string length for String validation. |
void |
setMaxLength(int maxLength)
Sets the maximum string length for String validation. |
void |
setMinLength(int minLength)
Sets the minimum string length for String validation. |
void |
setRequired(boolean required)
Sets whether or not a String is required (non null). |
void |
setWhiteSpace(String value)
Sets the whiteSpace facet of the validator. |
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. |
| 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 |
| Constructor Detail |
|---|
public StringValidator()
| Method Detail |
|---|
public void clearFixed()
public void setFixed(String fixedValue)
fixedValue - the fixed value that all Strings must matchpublic void setFixedValue(String fixedValue)
fixedValue - the fixed value that all Strings must matchpublic void setMaxLength(int maxLength)
maxLength - the maximum length for valid Stringspublic void setMinLength(int minLength)
minLength - the minimum length for valid Stringspublic void setLength(int length)
length - the required length for valid Stringspublic void setRequired(boolean required)
required - the flag indicating whether this string must be non-null.public void setWhiteSpace(String value)
The value of the whiteSpace facet must be one of the following:
FIXME: This is not really a function of validation, but of XML processing before the string is returned from the XML processor. This should be moved to the FieldHandler, or somewhere else, but not here.
value - the whiteSpace valuepublic String normalize(String value)
FIXME: THIS METHOD SHOULD NOT BE HERE..SHOULD BE MOVED TO A FieldHandler or to the Unmarshaller...but not here!!! (kvisco 20030125)
value - the String to normalize
public void validate(String value,
ValidationContext context)
throws ValidationException
validate in class PatternValidatorvalue - the string to validatecontext - the ValidationContext
ValidationException - if the object fails validation.#setPattern
public void validate(Object object)
throws ValidationException
object - the Object to validate
ValidationException - if the object fails validation.
public void validate(Object object,
ValidationContext context)
throws ValidationException
validate in interface TypeValidatorvalidate in class PatternValidatorobject - 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 | |||||||||