Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import java.lang.annotation.Target;

/**
* The annotated element must be false. Supported types are {@code boolean} and {@code Boolean}.
*
* <p>{@code null} elements are considered valid.
* The annotated element must be false.
* Supported types are {@code boolean} and {@code Boolean}.
* <p>
* {@code null} elements are considered valid.
*
* @author Emmanuel Bernard
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import java.lang.annotation.Target;

/**
* The annotated element must be true. Supported types are {@code boolean} and {@code Boolean}.
*
* <p>{@code null} elements are considered valid.
* The annotated element must be true.
* Supported types are {@code boolean} and {@code Boolean}.
* <p>
* {@code null} elements are considered valid.
*
* @author Emmanuel Bernard
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import java.lang.annotation.Target;

/**
* Marks an annotation as a Constraint class. Only annotations marked with Constraint are composable
* Marks an annotation as a constraint class.
* Only annotations marked with {@code @Constraint} are composable.
*/
@Retention(CLASS)
@Target({ANNOTATION_TYPE})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@
/**
* The annotated element must be a number whose value must be lower or equal to the specified
* maximum.
*
* <p>Supported types are:
*
* <p>
* Supported types are:
* <ul>
* <li>{@code BigDecimal}
* <li>{@code BigInteger}
* <li>{@code CharSequence}
* <li>{@code byte}, {@code short}, {@code int}, {@code long}, and their respective wrappers
* </ul>
*
* Note that {@code double} and {@code float} are not supported due to rounding errors (some
* providers might provide some approximative support).
*
* <p>{@code null} elements are considered valid.
* <p>
* {@code null} elements are considered valid.
*
* @author Emmanuel Bernard
*/
Expand All @@ -52,8 +50,8 @@
/**
* Specifies whether the specified maximum is inclusive or exclusive. By default, it is inclusive.
*
* @return {@code true} if the value must be lower or equal to the specified maximum, {@code
* false} if the value must be lower
* @return {@code true} if the value must be lower or equal to the specified maximum,
* {@code false} if the value must be lower
* @since 1.1
*/
boolean inclusive() default true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,18 @@
/**
* The annotated element must be a number whose value must be higher or equal to the specified
* minimum.
*
* <p>Supported types are:
*
* <p>
* Supported types are:
* <ul>
* <li>{@code BigDecimal}
* <li>{@code BigInteger}
* <li>{@code CharSequence}
* <li>{@code byte}, {@code short}, {@code int}, {@code long}, and their respective wrappers
* </ul>
*
* Note that {@code double} and {@code float} are not supported due to rounding errors (some
* providers might provide some approximative support).
*
* <p>{@code null} elements are considered valid.
* <p>
* {@code null} elements are considered valid.
*
* @author Emmanuel Bernard
*/
Expand All @@ -58,8 +56,8 @@
/**
* Specifies whether the specified maximum is inclusive or exclusive. By default, it is inclusive.
*
* @return {@code true} if the value must be lower or equal to the specified maximum, {@code
* false} if the value must be lower
* @return {@code true} if the value must be lower or equal to the specified maximum,
* {@code false} if the value must be lower
* @since 1.1
*/
boolean inclusive() default true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@

/**
* The annotated element must be a number within accepted range.
*
* <p>Supported types are:
*
* <p>
* Supported types are:
* <ul>
* <li>{@code BigDecimal}
* <li>{@code BigInteger}
* <li>{@code CharSequence}
* <li>{@code byte}, {@code short}, {@code int}, {@code long}, and their respective wrapper types
* </ul>
*
* <p>{@code null} elements are considered valid.
* <p>
* {@code null} elements are considered valid.
*
* @author Emmanuel Bernard
*/
Expand All @@ -38,14 +37,21 @@

Class<?>[] groups() default {};

/** Return maximum number of integral digits accepted for this number */
int integer();

/** Return maximum number of fractional digits accepted for this number */
int fraction() default 0;

/**
* Defines several {@link Digits} annotations on the same element.
*
* @see Digits
*/
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Digitses {
@interface Digitses {
Digits[] value();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

/**
* The string has to be a well-formed email address. Exact semantics of what makes up a valid email
* address are left to the provided Email Annotation ValidationAdapter providers. Accepts {@code
* CharSequence}.
*
* <p>{@code null} elements are considered valid.
* address are left to the provided Email Annotation ValidationAdapter providers.
* <p>
* Accepts {@code CharSequence}.
* {@code null} elements are considered valid.
*/
@Constraint
@Documented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@

/**
* The annotated element must be an instant, date or time in the future.
*
* <p><i>Now</i> is defined by the {@link Clock} Supplier attached to the {@link Validator}. The
* <p>
* <i>Now</i> is defined by the {@code Clock} Supplier attached to the {@code Validator}. The
* default clock defines the current time according to the virtual machine, applying the current
* default time zone if needed.
*
* <p>Supported types are:
*
* <p>
* Supported types are:
* <ul>
* <li>{@code java.util.Date}
* <li>{@code java.util.Calendar}
Expand All @@ -34,8 +33,8 @@
* <li>{@code java.time.YearMonth}
* <li>{@code java.time.ZonedDateTime}
* </ul>
*
* <p>{@code null} elements are considered valid.
* <p>
* {@code null} elements are considered valid.
*/
@Constraint
@Documented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@

/**
* The annotated element must be an instant, date or time in the present or in the future.
*
* <p><i>Now</i> is defined by the {@link Clock} Supplier attached to the {@link Validator}. The
* <p>
* <i>Now</i> is defined by the {@code Clock} Supplier attached to the {@code Validator}. The
* default clock defines the current time according to the virtual machine, applying the current
* default time zone if needed.
*
* <p>The notion of present here is defined relatively to the type on which the constraint is used.
* For instance, if the constraint is on a {@link Year}, present would mean the whole current year.
*
* <p>Supported types are:
*
* <p>
* The notion of present here is defined relatively to the type on which the constraint is used.
* For instance, if the constraint is on a {@code Year}, present would mean the whole current year.
* <p>
* Supported types are:
* <ul>
* <li>{@code java.util.Date}
* <li>{@code java.util.Calendar}
Expand All @@ -37,8 +36,8 @@
* <li>{@code java.time.YearMonth}
* <li>{@code java.time.ZonedDateTime}
* </ul>
*
* <p>{@code null} elements are considered valid.
* <p>
* {@code null} elements are considered valid.
*/
@Constraint
@Documented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

/**
* The annotated string length must be between the specified boundaries (included).
*
* <p>Supported types are:
* <p>
* Supported types are:
* <ul>
* <li>{@code CharSequence} (length of character sequence is evaluated)
* <li>{@code String} (length of character sequence is evaluated)
Expand All @@ -23,10 +23,17 @@

Class<?>[] groups() default {};

/** Return size the string must be higher or equal to */
int min() default 0;

/** Return size the string must be lower or equal to */
int max() default Integer.MAX_VALUE;

/**
* Defines several {@link Length} annotations on the same element.
*
* @see Length
*/
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@
import java.lang.annotation.Target;

/**
* The annotated element must be a number whose value must be lower or equal to the specified
* maximum.
*
* <p>Supported types are:
*
* The annotated element must be a number whose value must be lower or
* equal to the specified maximum.
* <p>
* Supported types are:
* <ul>
* <li>{@code BigDecimal}
* <li>{@code BigInteger}
* <li>{@code byte}, {@code short}, {@code int}, {@code long}, and their respective wrappers
* <li>{@code BigDecimal}</li>
* <li>{@code BigInteger}</li>
* <li>{@code byte}, {@code short}, {@code int}, {@code long}, and their respective
* wrappers</li>
* </ul>
*
* Note that {@code double} and {@code float} are not supported due to rounding errors (some
* providers might provide some approximative support).
*
* <p>{@code null} elements are considered valid.
* Note that {@code double} and {@code float} are not supported due to rounding errors
* (some providers might provide some approximative support).
* <p>
* {@code null} elements are considered valid.
*
* @author Emmanuel Bernard
*/
Expand All @@ -41,8 +40,14 @@

Class<?>[] groups() default {};

/** Return value the element must be lower or equal to */
long value();

/**
* Defines several {@link Max} annotations on the same element.
*
* @see Max
*/
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@
import java.lang.annotation.Target;

/**
* The annotated element must be a number whose value must be higher or equal to the specified
* minimum.
*
* <p>Supported types are:
*
* The annotated element must be a number whose value must be higher or
* equal to the specified minimum.
* <p>
* Supported types are:
* <ul>
* <li>{@code BigDecimal}
* <li>{@code BigInteger}
* <li>{@code byte}, {@code short}, {@code int}, {@code long}, and their respective wrappers
* <li>{@code BigDecimal}</li>
* <li>{@code BigInteger}</li>
* <li>{@code byte}, {@code short}, {@code int}, {@code long}, and their respective
* wrappers</li>
* </ul>
*
* Note that {@code double} and {@code float} are not supported due to rounding errors (some
* providers might provide some approximative support).
*
* <p>{@code null} elements are considered valid.
* Note that {@code double} and {@code float} are not supported due to rounding errors
* (some providers might provide some approximative support).
* <p>
* {@code null} elements are considered valid.
*
* @author Emmanuel Bernard
*/
Expand All @@ -41,8 +40,14 @@

Class<?>[] groups() default {};

/** Return value the element must be higher or equal to */
long value();

/**
* Defines several {@link Min} annotations on the same element.
*
* @see Min
*/
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@
import java.lang.annotation.Target;

/**
* The annotated element must be a strictly negative number (i.e. 0 is considered as an invalid
* value).
*
* <p>Supported types are:
*
* The annotated element must be a strictly negative number (i.e. 0 is considered as an
* invalid value).
* <p>
* Supported types are:
* <ul>
* <li>{@code BigDecimal}
* <li>{@code BigInteger}
* <li>{@code byte}, {@code short}, {@code int}, {@code long}, {@code float}, {@code double} and
* their respective wrappers
* <li>{@code BigDecimal}</li>
* <li>{@code BigInteger}</li>
* <li>{@code byte}, {@code short}, {@code int}, {@code long}, {@code float},
* {@code double} and their respective wrappers</li>
* </ul>
*
* <p>{@code null} elements are considered valid.
* <p>
* {@code null} elements are considered valid.
*
* @author Gunnar Morling
*/
Expand Down
Loading