public static class Validators.RequiredValueValidator<T> extends Validators.RequiredValidator<T>
CLASS_VERSION| Constructor and Description |
|---|
RequiredValueValidator(boolean pRequired,
T pRequiredValue)
Create a new instance.
|
RequiredValueValidator(java.lang.String pErrorCode,
boolean pRequired,
T pRequiredValue)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
T |
validateValue(java.lang.String pPropertyName,
java.lang.Object pValue,
ValidatorContext<?> pContext)
Validate (and possibly convert) the specified property value.
|
getClassesRequired, getClassRequired, getRequiredOption, getRequiredPredicate, isRequired, isSourceOnly, keyMustBePresent, setClassesRequired, setClassRequired, setRequired, setRequiredOption, setRequiredPredicate, setSourceOnlyassertAlphanumeric, assertBoolean, assertDateTime, assertDouble, assertInstanceOf, assertInstanceOf, assertInteger, assertInteger, assertLong, assertNotBlankString, assertNotEmpty, assertNotEmpty, assertNotNull, assertNotNull, assertString, assertString, assertString, assertUnicodeAlphanumeric, createInstance, createInstance, getBeanPropertyValueForValidation, getCheckedBeanPropertyValueForValidation, getErrorCode, getNameForClass, getNameForClasses, getParentValidator, getPropertyNames, getPropertyValue, getPropertyValue, hasProperty, isDigits, isRequired, setErrorCode, setParentValidator, setPropertyValue, validateBeanPropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetErrorCode, setErrorCodevalidateBeanPropertypublic RequiredValueValidator(boolean pRequired,
T pRequiredValue)
pRequired - whether a non-null value is requiredpRequiredValue - the required value, if the input
value is non-null.public RequiredValueValidator(java.lang.String pErrorCode,
boolean pRequired,
T pRequiredValue)
pErrorCode - the error code to use in error messages.pRequired - whether a non-null value is required.pRequiredValue - the required value, if the input.
value is non-null.public T validateValue(java.lang.String pPropertyName, java.lang.Object pValue, ValidatorContext<?> pContext)
ValidatorvalidateValue in interface Validator<T>validateValue in class Validators.RequiredValidator<T>pPropertyName - the name of the property being validated. This
is typically used as a key for fetching the value from pProperties.pValue - the fetched property valuepContext - the current validation context.