public class RequiredFieldValidator extends FieldValidatorSupport
<validators>
<!-- Plain Validator Syntax -->
<validator type="required">
<param name="fieldName">username</param>
<message>username must not be null</message>
</validator>
<!-- Field Validator Syntax -->
<field name="username">
<field-validator type="required">
<message>username must not be null</message>
</field-validator>
</field>
</validators>
currentValue, fieldName, typedefaultMessage, EMPTY_STRING, messageKey, stack, textProviderFactory| Constructor and Description |
|---|
RequiredFieldValidator() |
| Modifier and Type | Method and Description |
|---|---|
void |
validate(Object object)
The validation implementation must guarantee that setValidatorContext will
be called with a non-null ValidatorContext before validate is called.
|
getCurrentValue, getFieldName, getValidatorType, setFieldName, setValidatorTypeaddActionError, addFieldError, getDefaultMessage, getFieldValue, getMessage, getMessageKey, getMessageParameters, getValidatorContext, isShortCircuit, parse, setDefaultMessage, setMessageKey, setMessageParameters, setShortCircuit, setTextProviderFactory, setValidatorContext, setValueStackclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDefaultMessage, getMessage, getMessageKey, getMessageParameters, getValidatorContext, setDefaultMessage, setMessageKey, setMessageParameters, setValidatorContext, setValueStackpublic void validate(Object object) throws ValidationException
Validatorobject - the object to be validated.ValidationException - is thrown if there is validation error(s).Copyright © 2000–2018 Apache Software Foundation. All rights reserved.