@Singleton @Introspected public class DefaultConstraintValidators extends Object implements ConstraintValidatorRegistry
Modifier and Type | Class and Description |
---|---|
protected class |
DefaultConstraintValidators.ValidatorKey<A extends Annotation,T>
Key for caching validators.
|
Modifier | Constructor and Description |
---|---|
|
DefaultConstraintValidators()
Default constructor.
|
protected |
DefaultConstraintValidators(BeanContext beanContext)
Constructor used for DI.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConstraintValidator
public DefaultConstraintValidators()
@Inject protected DefaultConstraintValidators(@Nullable BeanContext beanContext)
beanContext
- The bean context@NonNull public <A extends Annotation,T> Optional<ConstraintValidator<A,T>> findConstraintValidator(@NonNull Class<A> constraintType, @NonNull Class<T> targetType)
ConstraintValidatorRegistry
findConstraintValidator
in interface ConstraintValidatorRegistry
A
- The annotation typeT
- The target typeconstraintType
- The annotation type of the constraint.targetType
- The type being validated.public ConstraintValidator<AssertFalse,Boolean> getAssertFalseValidator()
AssertFalse
validator.public ConstraintValidator<AssertTrue,Boolean> getAssertTrueValidator()
AssertTrue
validator.public DecimalMaxValidator<CharSequence> getDecimalMaxValidatorCharSequence()
DecimalMax
validator for char sequences.public DecimalMaxValidator<Number> getDecimalMaxValidatorNumber()
DecimalMax
validator for number.public DecimalMinValidator<CharSequence> getDecimalMinValidatorCharSequence()
DecimalMin
validator for char sequences.public DecimalMinValidator<Number> getDecimalMinValidatorNumber()
DecimalMin
validator for number.public DigitsValidator<Number> getDigitsValidatorNumber()
Digits
validator for number.public DigitsValidator<CharSequence> getDigitsValidatorCharSequence()
Digits
validator for char sequence.public ConstraintValidator<Max,Number> getMaxNumberValidator()
Max
validator for numbers.public ConstraintValidator<Min,Number> getMinNumberValidator()
Min
validator for numbers.public ConstraintValidator<Negative,Number> getNegativeNumberValidator()
Negative
validator for numbers.public ConstraintValidator<NegativeOrZero,Number> getNegativeOrZeroNumberValidator()
NegativeOrZero
validator for numbers.public ConstraintValidator<Positive,Number> getPositiveNumberValidator()
Positive
validator for numbers.public ConstraintValidator<PositiveOrZero,Number> getPositiveOrZeroNumberValidator()
PositiveOrZero
validator for numbers.public ConstraintValidator<NotBlank,CharSequence> getNotBlankValidator()
NotBlank
validator for char sequences.public ConstraintValidator<NotNull,Object> getNotNullValidator()
NotNull
validator.public ConstraintValidator<Null,Object> getNullValidator()
Null
validator.public ConstraintValidator<NotEmpty,byte[]> getNotEmptyByteArrayValidator()
NotEmpty
validator for byte[].public ConstraintValidator<NotEmpty,char[]> getNotEmptyCharArrayValidator()
NotEmpty
validator for char[].public ConstraintValidator<NotEmpty,boolean[]> getNotEmptyBooleanArrayValidator()
NotEmpty
validator for boolean[].public ConstraintValidator<NotEmpty,double[]> getNotEmptyDoubleArrayValidator()
NotEmpty
validator for double[].public ConstraintValidator<NotEmpty,float[]> getNotEmptyFloatArrayValidator()
NotEmpty
validator for float[].public ConstraintValidator<NotEmpty,int[]> getNotEmptyIntArrayValidator()
NotEmpty
validator for int[].public ConstraintValidator<NotEmpty,long[]> getNotEmptyLongArrayValidator()
NotEmpty
validator for long[].public ConstraintValidator<NotEmpty,Object[]> getNotEmptyObjectArrayValidator()
NotEmpty
validator for Object[].public ConstraintValidator<NotEmpty,short[]> getNotEmptyShortArrayValidator()
NotEmpty
validator for short[].public ConstraintValidator<NotEmpty,CharSequence> getNotEmptyCharSequenceValidator()
NotEmpty
validator for char sequence.public ConstraintValidator<NotEmpty,Collection> getNotEmptyCollectionValidator()
NotEmpty
validator for collection.public ConstraintValidator<NotEmpty,Map> getNotEmptyMapValidator()
NotEmpty
validator for map.public SizeValidator<Object[]> getSizeObjectArrayValidator()
Size
validator for Object[].public SizeValidator<byte[]> getSizeByteArrayValidator()
Size
validator for byte[].public SizeValidator<char[]> getSizeCharArrayValidator()
Size
validator for char[].public SizeValidator<boolean[]> getSizeBooleanArrayValidator()
Size
validator for boolean[].public SizeValidator<double[]> getSizeDoubleArrayValidator()
Size
validator for double[].public SizeValidator<float[]> getSizeFloatArrayValidator()
Size
validator for float[].public SizeValidator<int[]> getSizeIntArrayValidator()
Size
validator for int[].public SizeValidator<long[]> getSizeLongArrayValidator()
Size
validator for long[].public SizeValidator<short[]> getSizeShortArrayValidator()
Size
validator for short[].public SizeValidator<CharSequence> getSizeCharSequenceValidator()
Size
validator for CharSequence.public SizeValidator<Collection> getSizeCollectionValidator()
Size
validator for Collection.public SizeValidator<Map> getSizeMapValidator()
Size
validator for Map.public ConstraintValidator<Past,TemporalAccessor> getPastTemporalAccessorConstraintValidator()
Past
validator for temporal accessor.public ConstraintValidator<Past,Date> getPastDateConstraintValidator()
Past
validator for Date accessor.public ConstraintValidator<PastOrPresent,TemporalAccessor> getPastOrPresentTemporalAccessorConstraintValidator()
PastOrPresent
validator for temporal accessor.public ConstraintValidator<PastOrPresent,Date> getPastOrPresentDateConstraintValidator()
PastOrPresent
validator for Date accessor.public ConstraintValidator<Future,TemporalAccessor> getFutureTemporalAccessorConstraintValidator()
Future
validator for temporal accessor.public ConstraintValidator<Future,Date> getFutureDateConstraintValidator()
Future
validator for Date accessor.public ConstraintValidator<FutureOrPresent,TemporalAccessor> getFutureOrPresentTemporalAccessorConstraintValidator()
FutureOrPresent
validator for temporal accessor.public ConstraintValidator<FutureOrPresent,Date> getFutureOrPresentDateConstraintValidator()
FutureOrPresent
validator for Date accessor.protected <A extends Annotation,T> Optional<ConstraintValidator> findLocalConstraintValidator(@NonNull Class<A> constraintType, @NonNull Class<T> targetType)
A
- The annotation typeT
- The target typeconstraintType
- The constraint typetargetType
- The target type