@Singleton @Introspected public class DefaultConstraintValidators extends java.lang.Object implements ConstraintValidatorRegistry
Modifier and Type | Class and Description |
---|---|
protected class |
DefaultConstraintValidators.ValidatorKey<A extends java.lang.annotation.Annotation,T>
Key for caching validators.
|
Modifier | Constructor and Description |
---|---|
|
DefaultConstraintValidators()
Default constructor.
|
protected |
DefaultConstraintValidators(BeanContext beanContext)
Constructor used for DI.
|
Modifier and Type | Method and Description |
---|---|
<A extends java.lang.annotation.Annotation,T> |
findConstraintValidator(java.lang.Class<A> constraintType,
java.lang.Class<T> targetType)
Finds a constraint validator for the given type and target type.
|
protected <A extends java.lang.annotation.Annotation,T> |
findLocalConstraintValidator(java.lang.Class<A> constraintType,
java.lang.Class<T> targetType)
Last chance resolve for constraint validator.
|
ConstraintValidator<javax.validation.constraints.AssertFalse,java.lang.Boolean> |
getAssertFalseValidator()
The
AssertFalse validator. |
ConstraintValidator<javax.validation.constraints.AssertTrue,java.lang.Boolean> |
getAssertTrueValidator()
The
AssertTrue validator. |
DecimalMaxValidator<java.lang.CharSequence> |
getDecimalMaxValidatorCharSequence()
The
DecimalMax validator for char sequences. |
DecimalMaxValidator<java.lang.Number> |
getDecimalMaxValidatorNumber()
The
DecimalMax validator for number. |
DecimalMinValidator<java.lang.CharSequence> |
getDecimalMinValidatorCharSequence()
The
DecimalMin validator for char sequences. |
DecimalMinValidator<java.lang.Number> |
getDecimalMinValidatorNumber()
The
DecimalMin validator for number. |
DigitsValidator<java.lang.CharSequence> |
getDigitsValidatorCharSequence()
The
Digits validator for char sequence. |
DigitsValidator<java.lang.Number> |
getDigitsValidatorNumber()
The
Digits validator for number. |
ConstraintValidator<javax.validation.constraints.FutureOrPresent,java.time.temporal.TemporalAccessor> |
getFutureOrPresentTemporalAccessorConstraintValidator()
The
FutureOrPresent validator for temporal accessor. |
ConstraintValidator<javax.validation.constraints.Future,java.time.temporal.TemporalAccessor> |
getFutureTemporalAccessorConstraintValidator()
The
Future validator for temporal accessor. |
ConstraintValidator<javax.validation.constraints.Max,java.lang.Number> |
getMaxNumberValidator()
The
Max validator for numbers. |
ConstraintValidator<javax.validation.constraints.Min,java.lang.Number> |
getMinNumberValidator()
The
Min validator for numbers. |
ConstraintValidator<javax.validation.constraints.Negative,java.lang.Number> |
getNegativeNumberValidator()
The
Negative validator for numbers. |
ConstraintValidator<javax.validation.constraints.NegativeOrZero,java.lang.Number> |
getNegativeOrZeroNumberValidator()
The
NegativeOrZero validator for numbers. |
ConstraintValidator<javax.validation.constraints.NotBlank,java.lang.CharSequence> |
getNotBlankValidator()
The
NotBlank validator for char sequences. |
ConstraintValidator<javax.validation.constraints.NotEmpty,boolean[]> |
getNotEmptyBooleanArrayValidator()
The
NotEmpty validator for boolean[]. |
ConstraintValidator<javax.validation.constraints.NotEmpty,byte[]> |
getNotEmptyByteArrayValidator()
The
NotEmpty validator for byte[]. |
ConstraintValidator<javax.validation.constraints.NotEmpty,char[]> |
getNotEmptyCharArrayValidator()
The
NotEmpty validator for char[]. |
ConstraintValidator<javax.validation.constraints.NotEmpty,java.lang.CharSequence> |
getNotEmptyCharSequenceValidator()
The
NotEmpty validator for char sequence. |
ConstraintValidator<javax.validation.constraints.NotEmpty,java.util.Collection> |
getNotEmptyCollectionValidator()
The
NotEmpty validator for collection. |
ConstraintValidator<javax.validation.constraints.NotEmpty,double[]> |
getNotEmptyDoubleArrayValidator()
The
NotEmpty validator for double[]. |
ConstraintValidator<javax.validation.constraints.NotEmpty,float[]> |
getNotEmptyFloatArrayValidator()
The
NotEmpty validator for float[]. |
ConstraintValidator<javax.validation.constraints.NotEmpty,int[]> |
getNotEmptyIntArrayValidator()
The
NotEmpty validator for int[]. |
ConstraintValidator<javax.validation.constraints.NotEmpty,long[]> |
getNotEmptyLongArrayValidator()
The
NotEmpty validator for long[]. |
ConstraintValidator<javax.validation.constraints.NotEmpty,java.util.Map> |
getNotEmptyMapValidator()
The
NotEmpty validator for map. |
ConstraintValidator<javax.validation.constraints.NotEmpty,java.lang.Object[]> |
getNotEmptyObjectArrayValidator()
The
NotEmpty validator for Object[]. |
ConstraintValidator<javax.validation.constraints.NotEmpty,short[]> |
getNotEmptyShortArrayValidator()
The
NotEmpty validator for short[]. |
ConstraintValidator<javax.validation.constraints.NotNull,java.lang.Object> |
getNotNullValidator()
The
NotNull validator. |
ConstraintValidator<javax.validation.constraints.Null,java.lang.Object> |
getNullValidator()
The
Null validator. |
ConstraintValidator<javax.validation.constraints.PastOrPresent,java.time.temporal.TemporalAccessor> |
getPastOrPresentTemporalAccessorConstraintValidator()
The
PastOrPresent validator for temporal accessor. |
ConstraintValidator<javax.validation.constraints.Past,java.time.temporal.TemporalAccessor> |
getPastTemporalAccessorConstraintValidator()
The
Past validator for temporal accessor. |
ConstraintValidator<javax.validation.constraints.Positive,java.lang.Number> |
getPositiveNumberValidator()
The
Positive validator for numbers. |
ConstraintValidator<javax.validation.constraints.PositiveOrZero,java.lang.Number> |
getPositiveOrZeroNumberValidator()
The
PositiveOrZero validator for numbers. |
SizeValidator<boolean[]> |
getSizeBooleanArrayValidator()
The
Size validator for boolean[]. |
SizeValidator<byte[]> |
getSizeByteArrayValidator()
The
Size validator for byte[]. |
SizeValidator<char[]> |
getSizeCharArrayValidator()
The
Size validator for char[]. |
SizeValidator<java.lang.CharSequence> |
getSizeCharSequenceValidator()
The
Size validator for CharSequence. |
SizeValidator<java.util.Collection> |
getSizeCollectionValidator()
The
Size validator for Collection. |
SizeValidator<double[]> |
getSizeDoubleArrayValidator()
The
Size validator for double[]. |
SizeValidator<float[]> |
getSizeFloatArrayValidator()
The
Size validator for float[]. |
SizeValidator<int[]> |
getSizeIntArrayValidator()
The
Size validator for int[]. |
SizeValidator<long[]> |
getSizeLongArrayValidator()
The
Size validator for long[]. |
SizeValidator<java.util.Map> |
getSizeMapValidator()
The
Size validator for Map. |
SizeValidator<java.lang.Object[]> |
getSizeObjectArrayValidator()
The
Size validator for Object[]. |
SizeValidator<short[]> |
getSizeShortArrayValidator()
The
Size validator for short[]. |
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 java.lang.annotation.Annotation,T> java.util.Optional<ConstraintValidator<A,T>> findConstraintValidator(@NonNull java.lang.Class<A> constraintType, @NonNull java.lang.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<javax.validation.constraints.AssertFalse,java.lang.Boolean> getAssertFalseValidator()
AssertFalse
validator.public ConstraintValidator<javax.validation.constraints.AssertTrue,java.lang.Boolean> getAssertTrueValidator()
AssertTrue
validator.public DecimalMaxValidator<java.lang.CharSequence> getDecimalMaxValidatorCharSequence()
DecimalMax
validator for char sequences.public DecimalMaxValidator<java.lang.Number> getDecimalMaxValidatorNumber()
DecimalMax
validator for number.public DecimalMinValidator<java.lang.CharSequence> getDecimalMinValidatorCharSequence()
DecimalMin
validator for char sequences.public DecimalMinValidator<java.lang.Number> getDecimalMinValidatorNumber()
DecimalMin
validator for number.public DigitsValidator<java.lang.Number> getDigitsValidatorNumber()
Digits
validator for number.public DigitsValidator<java.lang.CharSequence> getDigitsValidatorCharSequence()
Digits
validator for char sequence.public ConstraintValidator<javax.validation.constraints.Max,java.lang.Number> getMaxNumberValidator()
Max
validator for numbers.public ConstraintValidator<javax.validation.constraints.Min,java.lang.Number> getMinNumberValidator()
Min
validator for numbers.public ConstraintValidator<javax.validation.constraints.Negative,java.lang.Number> getNegativeNumberValidator()
Negative
validator for numbers.public ConstraintValidator<javax.validation.constraints.NegativeOrZero,java.lang.Number> getNegativeOrZeroNumberValidator()
NegativeOrZero
validator for numbers.public ConstraintValidator<javax.validation.constraints.Positive,java.lang.Number> getPositiveNumberValidator()
Positive
validator for numbers.public ConstraintValidator<javax.validation.constraints.PositiveOrZero,java.lang.Number> getPositiveOrZeroNumberValidator()
PositiveOrZero
validator for numbers.public ConstraintValidator<javax.validation.constraints.NotBlank,java.lang.CharSequence> getNotBlankValidator()
NotBlank
validator for char sequences.public ConstraintValidator<javax.validation.constraints.NotNull,java.lang.Object> getNotNullValidator()
NotNull
validator.public ConstraintValidator<javax.validation.constraints.Null,java.lang.Object> getNullValidator()
Null
validator.public ConstraintValidator<javax.validation.constraints.NotEmpty,byte[]> getNotEmptyByteArrayValidator()
NotEmpty
validator for byte[].public ConstraintValidator<javax.validation.constraints.NotEmpty,char[]> getNotEmptyCharArrayValidator()
NotEmpty
validator for char[].public ConstraintValidator<javax.validation.constraints.NotEmpty,boolean[]> getNotEmptyBooleanArrayValidator()
NotEmpty
validator for boolean[].public ConstraintValidator<javax.validation.constraints.NotEmpty,double[]> getNotEmptyDoubleArrayValidator()
NotEmpty
validator for double[].public ConstraintValidator<javax.validation.constraints.NotEmpty,float[]> getNotEmptyFloatArrayValidator()
NotEmpty
validator for float[].public ConstraintValidator<javax.validation.constraints.NotEmpty,int[]> getNotEmptyIntArrayValidator()
NotEmpty
validator for int[].public ConstraintValidator<javax.validation.constraints.NotEmpty,long[]> getNotEmptyLongArrayValidator()
NotEmpty
validator for long[].public ConstraintValidator<javax.validation.constraints.NotEmpty,java.lang.Object[]> getNotEmptyObjectArrayValidator()
NotEmpty
validator for Object[].public ConstraintValidator<javax.validation.constraints.NotEmpty,short[]> getNotEmptyShortArrayValidator()
NotEmpty
validator for short[].public ConstraintValidator<javax.validation.constraints.NotEmpty,java.lang.CharSequence> getNotEmptyCharSequenceValidator()
NotEmpty
validator for char sequence.public ConstraintValidator<javax.validation.constraints.NotEmpty,java.util.Collection> getNotEmptyCollectionValidator()
NotEmpty
validator for collection.public ConstraintValidator<javax.validation.constraints.NotEmpty,java.util.Map> getNotEmptyMapValidator()
NotEmpty
validator for map.public SizeValidator<java.lang.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<java.lang.CharSequence> getSizeCharSequenceValidator()
Size
validator for CharSequence.public SizeValidator<java.util.Collection> getSizeCollectionValidator()
Size
validator for Collection.public SizeValidator<java.util.Map> getSizeMapValidator()
Size
validator for Map.public ConstraintValidator<javax.validation.constraints.Past,java.time.temporal.TemporalAccessor> getPastTemporalAccessorConstraintValidator()
Past
validator for temporal accessor.public ConstraintValidator<javax.validation.constraints.PastOrPresent,java.time.temporal.TemporalAccessor> getPastOrPresentTemporalAccessorConstraintValidator()
PastOrPresent
validator for temporal accessor.public ConstraintValidator<javax.validation.constraints.Future,java.time.temporal.TemporalAccessor> getFutureTemporalAccessorConstraintValidator()
Future
validator for temporal accessor.public ConstraintValidator<javax.validation.constraints.FutureOrPresent,java.time.temporal.TemporalAccessor> getFutureOrPresentTemporalAccessorConstraintValidator()
FutureOrPresent
validator for temporal accessor.protected <A extends java.lang.annotation.Annotation,T> java.util.Optional<ConstraintValidator> findLocalConstraintValidator(@NonNull java.lang.Class<A> constraintType, @NonNull java.lang.Class<T> targetType)
A
- The annotation typeT
- The target typeconstraintType
- The constraint typetargetType
- The target type