Package | Description |
---|---|
org.foxlabs.validation | |
org.foxlabs.validation.constraint | |
org.foxlabs.validation.metadata |
Modifier and Type | Method and Description |
---|---|
Constraint<? super V> |
ConstrainedMap.Entry.getConstraint()
Returns constraint to be used for value validation.
|
Modifier and Type | Class and Description |
---|---|
class |
ArrayElementConstraint<V>
This class provides
SequenceElementConstraint implementation
that performs validation of array elements. |
class |
CapitalizeAllConstraint
This class provides
CorrectConstraint implementation that
converts to upper case first letters of all words in a string. |
class |
CapitalizeConstraint
This class provides
CorrectConstraint implementation that
converts to upper case first letter of first word in a string. |
class |
CascadeConstraint<V>
This class provides
Constraint implementation that performs
cascade validation on an entity. |
class |
CheckConstraint<V>
This class provides base implementation of the
Constraint
interface that only checks value and doesn't modify it. |
class |
CoalesceConstraint
This class provides
CorrectConstraint implementation that
replaces all whitespaces with single character in a string. |
class |
CollectionElementConstraint<V>
This class provides
SequenceElementConstraint implementation
that performs validation of collection elements. |
class |
ConstraintAggregation<V>
This class provides base implementation of the
Constraint that
encapsulates other constraints to validate a value. |
class |
ConstraintComposition<V>
This class provides
ConstraintAggregation implementation that
is composition of the encapsulated constraints. |
class |
ConstraintConjunction<V>
This class provides
ConstraintAggregation implementation that
is conjunction of the encapsulated constraints. |
class |
ConstraintDisjunction<V>
This class provides
ConstraintAggregation implementation that
is disjunction of the encapsulated constraints. |
class |
ConstraintGroupWrapper<V>
This class provides ability to override groups of another constraint.
|
class |
ConstraintMessageWrapper<V>
This class provides ability to override error message of another constraint.
|
class |
ConstraintNegation<V>
This class provides
ConstraintAggregation implementation that
is negation of the encapsulated constraints. |
class |
ConstraintWrapper<V>
This class provides convenient implementation of the
Constraint
that can be subclassed to wrap another constraint. |
class |
CorrectConstraint<V>
This class provides base implementation of the
Constraint
interface that modifies (corrects) value and never throws
ConstraintViolationException . |
class |
CustomConstraint<V>
This class provides
Constraint implementation for custom
constraints. |
class |
DefaultValueConstraint<V>
This class provides
CorrectConstraint implementation that
replaces a null value with default value. |
class |
DespaceConstraint
This class provides
CorrectConstraint implementation that
removes all whitespaces from a string. |
class |
EmailAddressConstraint
This class provides
CheckConstraint implementation that checks
whether a string is valid email address. |
class |
EnumerationConstraint<V>
This class provides base implementation of the
CheckConstraint
that checks whether the specified value is one of the allowed constants. |
static class |
EnumerationConstraint.Default<V>
This class provides default
EnumerationConstraint
implementation based on static set of constants. |
class |
FileExistsConstraint
This class provides
CheckConstraint implementation that checks
existence of a file or directory. |
class |
FileSizeConstraint
This class provides
CheckConstraint implementation that checks
whether size of a file is within allowed minimum and maximum bounds. |
class |
FutureDateConstraint
This class provides
CheckConstraint implementation that checks
whether a date is date in the future. |
class |
HostnameConstraint
This class provides
CheckConstraint implementation that checks
whether a string is valid internet hostname according to
RFC 1123. |
class |
IdentifierConstraint
This class provides
CheckConstraint implementation that checks
whether a string is valid identifier. |
class |
IdentityConstraint
This class provides
Constraint implementation that just returns
value unchanged. |
class |
IgnoreCaseEnumerationConstraint
This class provides
EnumerationConstraint implementation based
on static set of case insensitive strings. |
class |
IllegalCharsetConstraint
This class provides
CheckConstraint implementation that checks
whether a string not contains disallowed characters. |
class |
ImageSizeConstraint<V>
This class provides base implementation of the
Constraint that
checks whether the size of an image is within maximum bounds. |
static class |
ImageSizeConstraint.AwtCodec
This class provides
ImageSizeConstraint implementation for
java.awt.Image type. |
static class |
ImageSizeConstraint.RawCodec
This class provides
ImageSizeConstraint implementation for
byte[] type. |
class |
InetAddressConstraint
This class provides
CheckConstraint implementation that checks
whether a string is valid internet address (can be either hostname or IP
address). |
class |
InstanceOfConstraint
This class provides
CheckConstraint implementation that checks
whether a value is instance of one of allowed types. |
class |
Ip4AddressConstraint
This class provides
CheckConstraint implementation that checks
whether a string is valid IPv4 address. |
class |
Ip6AddressConstraint
This class provides
CheckConstraint implementation that checks
whether a string is valid IPv6 address. |
class |
IpAddressConstraint
This class provides
CheckConstraint implementation that checks
whether a string is valid IPv4 or IPv6 address. |
class |
IsFalseConstraint
This class provides
CheckConstraint implementation that checks
whether a boolean value is false . |
class |
IsNullConstraint
This class provides
CheckConstraint implementation that checks
whether a value is null . |
class |
IsTrueConstraint
This class provides
CheckConstraint implementation that checks
whether a boolean value is true . |
class |
LegalCharsetConstraint
This class provides
CheckConstraint implementation that checks
whether a string contains allowed characters only. |
class |
LogLevelConstraint
This class provides
EnumerationConstraint implementation for
java.util.logging.Level known constants. |
class |
LowerCaseConstraint
This class provides
CorrectConstraint implementation that
converts a string to lower case. |
class |
MapKeyConstraint<V>
This class provides
SequenceElementConstraint implementation
that performs validation of map keys. |
class |
MapValueConstraint<V>
This class provides
SequenceElementConstraint implementation
that performs validation of map values. |
class |
MaxLengthConstraint
This class provides
CorrectConstraint implementation that
allows to cut length of a string. |
class |
MimeTypeConstraint
This class provides
RegexConstraint implementation that checks
whether a string is valid MIME type representation. |
class |
NotBlankConstraint
This class provides
CheckConstraint implementation that
checks whether a string is not null or empty. |
class |
NotEmptyConstraint<V>
This class provides base implementation of the
CheckConstraint
that checks whether a value is not empty. |
static class |
NotEmptyConstraint.ArrayType
This class provides
NotEmptyConstraint implementation for
all array types. |
static class |
NotEmptyConstraint.CollectionType
This class provides
NotEmptyConstraint implementation for
all JDK java.util.Collection types. |
static class |
NotEmptyConstraint.MapType
This class provides
NotEmptyConstraint implementation for
all JDK java.util.Map types. |
static class |
NotEmptyConstraint.StringType
This class provides
NotEmptyConstraint implementation for
java.lang.String type. |
class |
NotNullConstraint
This class provides
CheckConstraint implementation that checks
whether a value is not null . |
class |
NullifyConstraint
This class provides
CorrectConstraint implementation that
replaces an empty string with null . |
class |
PastDateConstraint
This class provides
CheckConstraint implementation that checks
whether a date is date in the past. |
class |
PropertyComparisonConstraint<V>
This class provides base implementation of the
CheckConstraint
that applies binary comparison operator to a value and other property. |
static class |
PropertyComparisonConstraint.EqualToOp<V>
This class provides
PropertyComparisonConstraint
implementation that applies == operator to a value and
other property. |
static class |
PropertyComparisonConstraint.GreaterThanEqualOp<V>
This class provides
PropertyComparisonConstraint
implementation that applies >= operator to a value and
other property. |
static class |
PropertyComparisonConstraint.GreaterThanOp<V>
This class provides
PropertyComparisonConstraint
implementation that applies > operator to a value and
other property. |
static class |
PropertyComparisonConstraint.LessThanEqualOp<V>
This class provides
PropertyComparisonConstraint
implementation that applies <= operator to a value and
other property. |
static class |
PropertyComparisonConstraint.LessThanOp<V>
This class provides
PropertyComparisonConstraint
implementation that applies < operator to a value and
other property. |
static class |
PropertyComparisonConstraint.NotEqualToOp<V>
This class provides
PropertyComparisonConstraint
implementation that applies != operator to a value and
other property. |
class |
RangeConstraint<V>
This class provides
CheckConstraint implementation that checks
whether a value is within allowed minimum and maximum range. |
class |
RegexConstraint
This class provides
CheckConstraint implementation that checks
whether a string matches the regular expression. |
class |
RemoveNullElementsConstraint<V>
This class provides base implementation of the
CorrectConstraint
that removes all null elements from a sequence. |
static class |
RemoveNullElementsConstraint.ArrayType
This class provides
RemoveNullElementsConstraint
implementation for all array types. |
static class |
RemoveNullElementsConstraint.CollectionType
This class provides
RemoveNullElementsConstraint
implementation for all JDK java.util.Collection types. |
class |
ReplaceConstraint
This class provides
CorrectConstraint implementation that
Replaces each substring of a string that matches the given regular
expression with the given replacement. |
class |
SequenceElementConstraint<V,E>
This class provides base implementation of the
Constraint that
uses another constraint to validate elements of a sequence. |
class |
SetNullConstraint
This class provides
CorrectConstraint implementation that
replaces a value with null . |
class |
SizeConstraint<V>
This class provides base implementation of the
CheckConstraint
that checks whether the size of a value is within allowed minimum and
maximum bounds. |
static class |
SizeConstraint.ArrayType
This class provides
SizeConstraint implementation for all
array types. |
static class |
SizeConstraint.CollectionType
This class provides
SizeConstraint implementation for all
JDK java.util.Collection types. |
static class |
SizeConstraint.MapType
This class provides
SizeConstraint implementation for all
JDK java.util.Map types. |
static class |
SizeConstraint.StringType
This class provides
SizeConstraint implementation for
java.lang.String type. |
class |
SupportedEncodingConstraint
This class provides
EnumerationConstraint implementation that
checks whether a string is in list of available charset names supported by
JRE. |
class |
SupportedImageMimeConstraint
This class provides
EnumerationConstraint implementation that
checks whether a string is in list of available image MIME types supported
by javax.imageio.ImageIO . |
class |
SupportedLocaleConstraint
This class provides
EnumerationConstraint implementation that
checks whether a locale is in list of available locales supported by JRE. |
class |
SupportedTimeZoneConstraint
This class provides
EnumerationConstraint implementation that
checks whether a time zone is in list of available time zones supported by
JRE. |
class |
SysdateConstraint
This class provides
CorrectConstraint implementation that
replaces a null date with current system date. |
class |
TrimConstraint
This class provides
CorrectConstraint implementation that
removes leading and trailing whitespaces from a string. |
class |
UpperCaseConstraint
This class provides
CorrectConstraint implementation that
converts a string to upper case. |
class |
UriAddressConstraint
This class provides
CheckConstraint implementation that checks
whether a string is valid URI reference. |
class |
UrlAddressConstraint
This class provides
CheckConstraint implementation that checks
whether a string is valid URL reference. |
Modifier and Type | Field and Description |
---|---|
protected Constraint<E> |
SequenceElementConstraint.constraint
Constraint to be used to validate elements of a sequence.
|
protected Constraint<V> |
ConstraintWrapper.constraint
Wrapped constraint.
|
protected Constraint<? super V>[] |
ConstraintAggregation.constraints
Array of constraints to be used for validation of a value.
|
Modifier and Type | Method and Description |
---|---|
static <T extends Constraint<?>> |
ConstraintFactory.findConstraint(Constraint<?> wrapper,
Class<T> requiredType)
Searches constraint by its type in the specified one.
|
Modifier and Type | Method and Description |
---|---|
static <V> Constraint<V> |
ConstraintFactory.and(Class<V> type,
Collection<Constraint<? super V>> constraints)
Returns constraint that is conjunction of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.and(Class<V> type,
Constraint<? super V>... constraints)
Returns constraint that is conjunction of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.and(Collection<Constraint<? super V>> constraints)
Returns constraint that is conjunction of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.and(Constraint<? super V>... constraints)
Returns constraint that is conjunction of the specified constraints.
|
static <V> Constraint<? super V[]> |
ConstraintFactory.arrayElement(Constraint<V> constraint)
Returns constraint that performs validation of array elements.
|
static <V> Constraint<V> |
ConstraintFactory.arrayMaxSize(int max)
Returns constraint that checks whether the length of an array is not
greater than allowed maximum length.
|
static <V> Constraint<V> |
ConstraintFactory.arrayMinSize(int min)
Returns constraint that checks whether the length of an array is not
less than allowed minimum length.
|
static <V> Constraint<V> |
ConstraintFactory.arrayNotEmpty()
Returns constraint that checks whether an array is not empty.
|
static <V> Constraint<V> |
ConstraintFactory.arrayRemoveNullElements()
Returns constraint that removes all
null elements from an
array. |
static <V> Constraint<V> |
ConstraintFactory.arraySize(int min,
int max)
Returns constraint that checks whether the length of an array is within
allowed minimum and maximum bounds.
|
static Constraint<Image> |
ConstraintFactory.awtImageSize(int maxWidth,
int maxHeight,
ImageAdjust adjust)
Returns constraint that checks whether the size of an image is within
maximum bounds.
|
static Constraint<String> |
ConstraintFactory.capitalize()
Returns constraint that converts to upper case first letter of first
word in a string.
|
static Constraint<String> |
ConstraintFactory.capitalizeAll()
Returns constraint that converts to upper case first letters of all
words in a string.
|
static <V> Constraint<V> |
ConstraintFactory.cascade(Class<V> type)
Returns constraint that performs cascade validation on an entity.
|
static <V> Constraint<V> |
ConstraintFactory.cascade(EntityMetaData<V> metadata)
Returns constraint that performs cascade validation on an entity.
|
static Constraint<String> |
ConstraintFactory.coalesce()
Returns constraint that replaces all whitespaces with
' '
character in a string. |
static Constraint<String> |
ConstraintFactory.coalesce(char replacement,
boolean multiline)
Returns constraint that replaces all whitespaces with single character
in a string.
|
static <V> Constraint<? super Collection<V>> |
ConstraintFactory.collectionElement(Constraint<V> constraint)
Returns constraint that performs validation of collection elements.
|
static <V extends Collection<?>> |
ConstraintFactory.collectionMaxSize(int max)
Returns constraint that checks whether the size of a collection is not
greater than allowed maximum size.
|
static <V extends Collection<?>> |
ConstraintFactory.collectionMinSize(int min)
Returns constraint that checks whether the size of a collection is not
less than allowed minimum size.
|
static <V extends Collection<?>> |
ConstraintFactory.collectionNotEmpty()
Returns constraint that checks whether a collection is not empty.
|
static <V extends Collection<?>> |
ConstraintFactory.collectionRemoveNullElements()
Returns constraint that removes all
null elements from a
collection. |
static <V extends Collection<?>> |
ConstraintFactory.collectionSize(int min,
int max)
Returns constraint that checks whether the size of a collection is
within allowed minimum and maximum bounds.
|
static <V> Constraint<? super V> |
ConstraintFactory.createConstraint(Type type,
Annotation[] annotations,
String namespace,
ValidationDefaults defaults)
Creates a new constraint for the specified generic value type using
configuration from the specified annotations.
|
static <V> Constraint<V> |
ConstraintFactory.defaultValue(V defaultValue)
Returns constraint that replaces a
null value with default
value. |
static Constraint<String> |
ConstraintFactory.despace()
Returns constraint that removes all whitespaces from a string.
|
static Constraint<File> |
ConstraintFactory.directoryExists()
Returns constraint that checks existence of a directory.
|
static Constraint<String> |
ConstraintFactory.emailAddress()
Returns constraint that checks whether a string is valid email address.
|
static <V extends Enum<V>> |
ConstraintFactory.enumeration(Class<V> type)
Returns constraint that lists constants of the specified enumeration
type.
|
static <V> Constraint<V> |
ConstraintFactory.enumeration(Class<V> type,
Collection<V> constants)
Returns constraint that checks whether a value is one of the allowed
constants.
|
static <V> Constraint<V> |
ConstraintFactory.enumeration(Class<V> type,
V... constants)
Returns constraint that checks whether a value is one of the allowed
constants.
|
static <V> Constraint<V> |
ConstraintFactory.enumeration(Collection<V> constants)
Returns constraint that checks whether a value is one of the allowed
constants.
|
static <V> Constraint<V> |
ConstraintFactory.enumeration(V... constants)
Returns constraint that checks whether a value is one of the allowed
constants.
|
static <V> Constraint<V> |
ConstraintFactory.eq(Class<V> type,
String property)
Returns constraint that applies
== operator to a value
and the specified property. |
static <V> Constraint<V> |
ConstraintFactory.eq(Class<V> type,
String property,
Comparator<V> comparator)
Returns constraint that applies
== operator to a value
and the specified property. |
static Constraint<File> |
ConstraintFactory.fileExists()
Returns constraint that checks existence of a file.
|
static Constraint<File> |
ConstraintFactory.fileSize(long min,
long max)
Returns constraint that checks whether size of a file is within allowed
minimum and maximum bounds.
|
static Constraint<Date> |
ConstraintFactory.futureDate()
Returns constraint that checks whether a date is date in the future.
|
Constraint<E> |
SequenceElementConstraint.getConstraint()
Returns constraint to be used to validate elements of a sequence.
|
Constraint<?> |
ConstraintViolationException.getConstraint()
Returns constraint that is source of this exception.
|
Constraint<V> |
ConstraintWrapper.getConstraint()
Returns wrapped constraint.
|
Constraint<? super V>[] |
ConstraintAggregation.getConstraints()
Returns array of constraints to be used for validation of a value.
|
static <V extends Comparable<? super V>> |
ConstraintFactory.gt(Class<V> type,
String property)
Returns constraint that applies
> operator to a value
and the specified property. |
static <V> Constraint<V> |
ConstraintFactory.gt(Class<V> type,
String property,
Comparator<V> comparator)
Returns constraint that applies
> operator to a value
and the specified property. |
static <V extends Comparable<? super V>> |
ConstraintFactory.gte(Class<V> type,
String property)
Returns constraint that applies
>= operator to a value
and the specified property. |
static <V> Constraint<V> |
ConstraintFactory.gte(Class<V> type,
String property,
Comparator<V> comparator)
Returns constraint that applies
>= operator to a value
and the specified property. |
static Constraint<String> |
ConstraintFactory.hostname()
Returns constraint that checks whether a string is valid internet
hostname.
|
static Constraint<String> |
ConstraintFactory.identifier()
Returns constraint that checks whether a string is valid identifier.
|
static <V> Constraint<? super V> |
ConstraintFactory.identity()
Returns constraint that just returns value unchanged.
|
static Constraint<String> |
ConstraintFactory.ignoreCaseEnumeration(Collection<String> constants)
Returns constraint that checks whether a string is one of the allowed
strings ignoring case considerations.
|
static Constraint<String> |
ConstraintFactory.ignoreCaseEnumeration(String... constants)
Returns constraint that checks whether a string is one of the allowed
strings ignoring case considerations.
|
static Constraint<String> |
ConstraintFactory.illegalCharset(String pattern)
Returns constraint that checks whether a string not contains disallowed
characters.
|
static Constraint<String> |
ConstraintFactory.illegalCharset(org.foxlabs.util.UnicodeSet charset)
Returns constraint that checks whether a string not contains disallowed
characters.
|
static Constraint<String> |
ConstraintFactory.inetAddress()
Returns constraint that checks whether a string is valid internet
address (can be either hostname or IP address).
|
static <V> Constraint<? super V> |
ConstraintFactory.instanceOf(Class<?>... types)
Returns constraint that checks whether a value is instance of one of the
specified types.
|
static Constraint<String> |
ConstraintFactory.ip4Address()
Returns constraint that checks whether a string is valid IPv4 address.
|
static Constraint<String> |
ConstraintFactory.ip6Address()
Returns constraint that checks whether a string is valid IPv6 address.
|
static Constraint<String> |
ConstraintFactory.ipAddress()
Returns constraint that checks whether a string is valid IPv4 or IPv6
address.
|
static Constraint<Boolean> |
ConstraintFactory.isFalse()
Returns constraint that checks whether a boolean value is
false . |
static <V> Constraint<? super V> |
ConstraintFactory.isNull()
Returns constraint that checks whether a value is
null . |
static Constraint<Boolean> |
ConstraintFactory.isTrue()
Returns constraint that checks whether a boolean value is
true . |
static <V> Constraint<V> |
ConstraintFactory.join(Class<V> type,
Collection<Constraint<? super V>> constraints)
Returns constraint that is composition of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.join(Class<V> type,
Constraint<? super V>... constraints)
Returns constraint that is composition of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.join(Collection<Constraint<? super V>> constraints)
Returns constraint that is composition of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.join(Constraint<? super V>... constraints)
Returns constraint that is composition of the specified constraints.
|
static Constraint<String> |
ConstraintFactory.legalCharset(String pattern)
Returns constraint that checks whether a string contains allowed
characters only.
|
static Constraint<String> |
ConstraintFactory.legalCharset(org.foxlabs.util.UnicodeSet charset)
Returns constraint that checks whether a string contains allowed
characters only.
|
static Constraint<Level> |
ConstraintFactory.logLevel()
Returns constraint that checks whether a log level is in list of known
log levels.
|
static Constraint<String> |
ConstraintFactory.lowerCase()
Returns constraint that converts a string to lower case.
|
static <V extends Comparable<? super V>> |
ConstraintFactory.lt(Class<V> type,
String property)
Returns constraint that applies
< operator to a value
and the specified property. |
static <V> Constraint<V> |
ConstraintFactory.lt(Class<V> type,
String property,
Comparator<V> comparator)
Returns constraint that applies
< operator to a value
and the specified property. |
static <V extends Comparable<? super V>> |
ConstraintFactory.lte(Class<V> type,
String property)
Returns constraint that applies
<= operator to a value
and the specified property. |
static <V> Constraint<V> |
ConstraintFactory.lte(Class<V> type,
String property,
Comparator<V> comparator)
Returns constraint that applies
<= operator to a value
and the specified property. |
static <V> Constraint<? super Map<V,Object>> |
ConstraintFactory.mapKey(Constraint<V> constraint)
Returns constraint that performs validation of map keys.
|
static <V extends Map<?,?>> |
ConstraintFactory.mapMaxSize(int max)
Returns constraint that checks whether the size of a map is not greater
than allowed maximum size.
|
static <V extends Map<?,?>> |
ConstraintFactory.mapMinSize(int min)
Returns constraint that checks whether the size of a map is not less
than allowed minimum size.
|
static <V extends Map<?,?>> |
ConstraintFactory.mapNotEmpty()
Returns constraint that checks whether a map is not empty.
|
static <V extends Map<?,?>> |
ConstraintFactory.mapSize(int min,
int max)
Returns constraint that checks whether the size of a map is within
allowed minimum and maximum bounds.
|
static <V> Constraint<? super Map<Object,V>> |
ConstraintFactory.mapValue(Constraint<V> constraint)
Returns constraint that performs validation of map values.
|
static <V extends Comparable<? super V>> |
ConstraintFactory.max(V max)
Returns constraint that checks whether a value is not greater than
allowed maximum value.
|
static <V> Constraint<V> |
ConstraintFactory.max(V max,
Comparator<V> comparator)
Returns constraint that checks whether a value is not greater than
allowed maximum value.
|
static Constraint<String> |
ConstraintFactory.maxLength(int limit)
Returns constraint that allows to cut length of a string.
|
static Constraint<String> |
ConstraintFactory.mimetype()
Returns constraint that checks whether a string is valid mime type
representation.
|
static <V extends Comparable<? super V>> |
ConstraintFactory.min(V min)
Returns constraint that checks whether a value is not less than
allowed minimum value.
|
static <V> Constraint<V> |
ConstraintFactory.min(V min,
Comparator<V> comparator)
Returns constraint that checks whether a value is not less than
allowed minimum value.
|
static <V> Constraint<V> |
ConstraintFactory.ne(Class<V> type,
String property)
Returns constraint that applies
!= operator to a value
and the specified property. |
static <V> Constraint<V> |
ConstraintFactory.ne(Class<V> type,
String property,
Comparator<V> comparator)
Returns constraint that applies
!= operator to a value
and the specified property. |
static <V> Constraint<V> |
ConstraintFactory.not(Class<V> type,
Collection<Constraint<? super V>> constraints)
Returns constraint that is negation of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.not(Class<V> type,
Constraint<? super V>... constraints)
Returns constraint that is negation of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.not(Collection<Constraint<? super V>> constraints)
Returns constraint that is negation of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.not(Constraint<? super V>... constraints)
Returns constraint that is negation of the specified constraints.
|
static Constraint<String> |
ConstraintFactory.notBlank()
Returns constraint that checks whether a string is not
null
or empty. |
static <V> Constraint<? super V> |
ConstraintFactory.notNull()
Returns constraint that checks whether a value is not
null . |
static Constraint<String> |
ConstraintFactory.nullify()
Returns constraint that replaces an empty string with
null . |
static <V> Constraint<V> |
ConstraintFactory.or(Class<V> type,
Collection<Constraint<? super V>> constraints)
Returns constraint that is disjunction of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.or(Class<V> type,
Constraint<? super V>... constraints)
Returns constraint that is disjunction of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.or(Collection<Constraint<? super V>> constraints)
Returns constraint that is disjunction of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.or(Constraint<? super V>... constraints)
Returns constraint that is disjunction of the specified constraints.
|
static Constraint<Date> |
ConstraintFactory.pastDate()
Returns constraint that checks whether a date is date in the past.
|
static <V extends Comparable<? super V>> |
ConstraintFactory.range(V min,
V max)
Returns constraint that checks whether a value is within allowed
minimum and maximum range.
|
static <V> Constraint<V> |
ConstraintFactory.range(V min,
V max,
Comparator<V> comparator)
Returns constraint that checks whether a value is within allowed
minimum and maximum range.
|
static Constraint<byte[]> |
ConstraintFactory.rawImageSize(int maxWidth,
int maxHeight,
ImageAdjust adjust)
Returns constraint that checks whether the size of a raw image is within
maximum bounds.
|
static Constraint<String> |
ConstraintFactory.regex(String pattern)
Returns constraint that checks whether a string matches the regular
expression.
|
static Constraint<String> |
ConstraintFactory.regex(String pattern,
int flags)
Returns constraint that checks whether a string matches the regular
expression.
|
static Constraint<String> |
ConstraintFactory.replace(String regex,
String replacement)
Returns constraint that replaces each substring of a string that matches
the given regular expression with the given replacement.
|
static Constraint<String> |
ConstraintFactory.replace(String regex,
String replacement,
int flags)
Returns constraint that replaces each substring of a string that matches
the given regular expression with the given replacement.
|
static <V> Constraint<V> |
ConstraintFactory.setNull()
Returns constraint that replaces a value with
null . |
static Constraint<String> |
ConstraintFactory.stringMaxSize(int max)
Returns constraint that checks whether the length of a string is not
greater than allowed maximum length.
|
static Constraint<String> |
ConstraintFactory.stringMinSize(int min)
Returns constraint that checks whether the length of a string is not
less than allowed minimum length.
|
static Constraint<String> |
ConstraintFactory.stringNotEmpty()
Returns constraint that checks whether a string is not empty.
|
static Constraint<String> |
ConstraintFactory.stringSize(int min,
int max)
Returns constraint that checks whether the length of a string is within
allowed minimum and maximum bounds.
|
static Constraint<String> |
ConstraintFactory.supportedEncoding()
Returns constraint that checks whether a string is in list of available
charset names supported by JRE.
|
static Constraint<String> |
ConstraintFactory.supportedImageMime()
Returns constraint that checks whether a string is in list of available
image MIME types supported by
javax.imageio.ImageIO . |
static Constraint<Locale> |
ConstraintFactory.supportedLocale()
Returns constraint that checks whether a locale is in list of available
locales supported by JRE.
|
static Constraint<TimeZone> |
ConstraintFactory.supportedTimeZone()
Returns constraint that checks whether a time zone is in list of
available time zones supported by JRE.
|
static Constraint<Date> |
ConstraintFactory.sysdate()
Returns constraint that replaces a
null date with current
system date. |
static Constraint<String> |
ConstraintFactory.trim()
Returns constraint that removes leading and trailing whitespaces from a
string.
|
static <V> Constraint<V> |
ConstraintFactory.unwrapConstraint(Constraint<V> wrapper)
Returns unwrapped constraint for the specified one.
|
static Constraint<String> |
ConstraintFactory.upperCase()
Returns constraint that converts a string to upper case.
|
static Constraint<String> |
ConstraintFactory.uriAddress()
Returns constraint that checks whether a string is valid URI reference.
|
static Constraint<String> |
ConstraintFactory.uriAddress(String... schemes)
Returns constraint that checks whether a string is valid URI reference
with allowed scheme.
|
static Constraint<String> |
ConstraintFactory.urlAddress()
Returns constraint that checks whether a string is valid URL reference.
|
static Constraint<String> |
ConstraintFactory.urlAddress(String prefix,
String... protocols)
Returns constraint that checks whether a string is valid URL reference
with allowed prefix and protocol.
|
static <V> Constraint<V> |
ConstraintFactory.wrapGroups(Constraint<V> constraint)
Wraps groups of the specified constraint by default.
|
static <V> Constraint<V> |
ConstraintFactory.wrapGroups(Constraint<V> constraint,
String... groups)
Wraps groups of the specified constraint.
|
static <V> Constraint<V> |
ConstraintFactory.wrapMessage(Constraint<V> constraint,
String message)
Wraps error message of the specified constraint.
|
Modifier and Type | Method and Description |
---|---|
static <V> Constraint<V> |
ConstraintFactory.and(Class<V> type,
Constraint<? super V>... constraints)
Returns constraint that is conjunction of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.and(Constraint<? super V>... constraints)
Returns constraint that is conjunction of the specified constraints.
|
static <V> Constraint<? super V[]> |
ConstraintFactory.arrayElement(Constraint<V> constraint)
Returns constraint that performs validation of array elements.
|
static <V> Constraint<? super Collection<V>> |
ConstraintFactory.collectionElement(Constraint<V> constraint)
Returns constraint that performs validation of collection elements.
|
static <V> Set<V> |
ConstraintFactory.findConstants(Constraint<?> wrapper)
Searches enumeration constants for the specified constraint.
|
static <T extends Constraint<?>> |
ConstraintFactory.findConstraint(Constraint<?> wrapper,
Class<T> requiredType)
Searches constraint by its type in the specified one.
|
static <V> V |
ConstraintFactory.findDefaultValue(Constraint<?> wrapper)
Searches default value for the specified constraint.
|
static Set<String> |
ConstraintFactory.getGroups(Constraint<?> constraint)
Returns set of groups the specified constraint is applied on.
|
static boolean |
ConstraintFactory.hasWrappedMessage(Constraint<?> constraint)
Determines if the specified constraint has wrapped error message.
|
static <V> Constraint<V> |
ConstraintFactory.join(Class<V> type,
Constraint<? super V>... constraints)
Returns constraint that is composition of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.join(Constraint<? super V>... constraints)
Returns constraint that is composition of the specified constraints.
|
static <V> Constraint<? super Map<V,Object>> |
ConstraintFactory.mapKey(Constraint<V> constraint)
Returns constraint that performs validation of map keys.
|
static <V> Constraint<? super Map<Object,V>> |
ConstraintFactory.mapValue(Constraint<V> constraint)
Returns constraint that performs validation of map values.
|
static <V> Constraint<V> |
ConstraintFactory.not(Class<V> type,
Constraint<? super V>... constraints)
Returns constraint that is negation of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.not(Constraint<? super V>... constraints)
Returns constraint that is negation of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.or(Class<V> type,
Constraint<? super V>... constraints)
Returns constraint that is disjunction of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.or(Constraint<? super V>... constraints)
Returns constraint that is disjunction of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.unwrapConstraint(Constraint<V> wrapper)
Returns unwrapped constraint for the specified one.
|
static <V> Constraint<V> |
ConstraintFactory.wrapGroups(Constraint<V> constraint)
Wraps groups of the specified constraint by default.
|
static <V> Constraint<V> |
ConstraintFactory.wrapGroups(Constraint<V> constraint,
String... groups)
Wraps groups of the specified constraint.
|
static <V> Constraint<V> |
ConstraintFactory.wrapMessage(Constraint<V> constraint,
String message)
Wraps error message of the specified constraint.
|
Modifier and Type | Method and Description |
---|---|
static <V> Constraint<V> |
ConstraintFactory.and(Class<V> type,
Collection<Constraint<? super V>> constraints)
Returns constraint that is conjunction of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.and(Collection<Constraint<? super V>> constraints)
Returns constraint that is conjunction of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.join(Class<V> type,
Collection<Constraint<? super V>> constraints)
Returns constraint that is composition of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.join(Collection<Constraint<? super V>> constraints)
Returns constraint that is composition of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.not(Class<V> type,
Collection<Constraint<? super V>> constraints)
Returns constraint that is negation of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.not(Collection<Constraint<? super V>> constraints)
Returns constraint that is negation of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.or(Class<V> type,
Collection<Constraint<? super V>> constraints)
Returns constraint that is disjunction of the specified constraints.
|
static <V> Constraint<V> |
ConstraintFactory.or(Collection<Constraint<? super V>> constraints)
Returns constraint that is disjunction of the specified constraints.
|
Constructor and Description |
---|
ConstraintAggregation(Class<?> type,
Constraint<? super V>... constraints)
Constructs a new
ConstraintAggregation with the specified
value type and array of other constraints. |
ConstraintViolationException(Constraint<?> constraint,
ValidationContext<?> context,
Object value)
Constructs a new
ConstraintViolationException with the
specified constraint, context and invalid value. |
ConstraintViolationException(Constraint<?> constraint,
ValidationContext<?> context,
Object value,
Throwable cause)
Constructs a new
ConstraintViolationException with the
specified constraint, context, invalid value and cause. |
ConstraintWrapper(Constraint<V> constraint)
Constructs a new
ConstraintWrapper with the specified
constraint. |
SequenceElementConstraint(Constraint<E> constraint)
Constructs a new
SequenceElementConstraint with the
specified constraint of elements. |
Modifier and Type | Field and Description |
---|---|
protected Constraint<? super T> |
AbstractEntityMetaData.constraint
Constraint to be used for entity validation.
|
protected Constraint<? super V> |
AbstractPropertyMetaData.constraint
Constraint to be used for property value validation.
|
protected Constraint<? super T> |
MetaDataBuilder.constraint
Constraint to be used for entity validation.
|
Modifier and Type | Method and Description |
---|---|
Constraint<? super T> |
AbstractEntityMetaData.getConstraint()
Returns constraint to be used for entity validation.
|
Constraint<? super V> |
AbstractPropertyMetaData.getConstraint()
Returns constraint to be used for property value validation.
|
Constraint<? super T> |
MetaData.getConstraint()
Returns constraint to be used for data validation.
|
Modifier and Type | Method and Description |
---|---|
MetaDataBuilder<T> |
MetaDataBuilder.constraint(Constraint<? super T> constraint)
Defines constraint to be used for entity validation.
|
<V> MetaDataBuilder<T> |
MetaDataBuilder.property(String name,
Class<V> type,
Constraint<? super V> constraint)
Defines a property with the specified name, type and constraint.
|
<V> MetaDataBuilder<T> |
MetaDataBuilder.property(String name,
Class<V> type,
Constraint<? super V> constraint,
V defaultValue)
Defines a property with the specified name, type, constraint and
default value.
|
<V> MetaDataBuilder<T> |
MetaDataBuilder.property(String name,
Converter<V> converter,
Constraint<? super V> constraint)
Defines a property with the specified name, converter and constraint.
|
<V> MapMetaData.Builder |
MapMetaData.Builder.property(String name,
Converter<V> converter,
Constraint<? super V> constraint,
V defaultValue)
Defines a property with the specified name, converter, constraint
and default value.
|
abstract <V> MetaDataBuilder<T> |
MetaDataBuilder.property(String name,
Converter<V> converter,
Constraint<? super V> constraint,
V defaultValue)
Defines a property with the specified name, converter, constraint
and default value.
|
Constructor and Description |
---|
AbstractEntityMetaData(Constraint<? super T> constraint,
Map<String,? extends PropertyMetaData<T,Object>> properties)
Constructs a new
AbstractEntityMetaData with the specified
entity constraint and properties metadata. |
AbstractPropertyMetaData(String name,
Converter<V> converter,
Constraint<? super V> constraint,
V defaultValue)
Constructs a new
AbstractPropertyMetaData with the specified
name, converter, constraint and default value. |
BeanMetaData(Class<T> type,
Constraint<? super T> constraint,
Map<String,BeanMetaData.Property<T,Object>> properties)
Constructs a new
BeanMetaData with the specified bean type,
constraint and properties metadata. |
MapMetaData(Constraint<? super Map<String,Object>> constraint,
Map<String,MapMetaData.Property<Object>> properties)
Constructs a new
MapMetaData with the specified map
constraint and properties metadata. |
Property(String name,
Converter<V> converter,
Constraint<? super V> constraint,
org.foxlabs.util.reflect.PropertyGetter getter,
org.foxlabs.util.reflect.PropertySetter setter,
V defaultValue)
Constructs a new
BeanPropertyMetaData with the specified
name, converter, constraint, property getter and setter. |
Property(String name,
Converter<V> converter,
Constraint<? super V> constraint,
V defaultValue)
Constructs a new
MapMetaData.Property with the
specified name, converter, constraint and default value. |
Copyright © 2011–2020 FoxLabs. All rights reserved.