From 5388c7744374f3e8133ed431173528c632c843c5 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Thu, 22 Jun 2017 22:01:21 +0200 Subject: [PATCH] Upgrade the tck-audit.xml as of CR1 --- .../EmailConstraintTest.java | 4 +- .../FuturePastConstraintsTest.java | 12 ++-- .../NotBlankConstraintTest.java | 4 +- .../NotEmptyConstraintTest.java | 2 +- .../PatternConstraintTest.java | 2 +- .../ContainerElementTypeDescriptorTest.java | 8 +-- .../metadata/ParameterDescriptorTest.java | 5 +- .../metadata/PropertyDescriptorTest.java | 3 +- .../metadata/ReturnValueDescriptorTest.java | 3 +- .../tests/time/ClockProviderFutureTest.java | 4 +- tests/src/main/resources/tck-audit.xml | 63 ++++++++++++------- 11 files changed, 67 insertions(+), 43 deletions(-) diff --git a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/EmailConstraintTest.java b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/EmailConstraintTest.java index dca9fbaf..95ef7cfb 100644 --- a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/EmailConstraintTest.java +++ b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/EmailConstraintTest.java @@ -46,7 +46,7 @@ public static WebArchive createTestArchive() { @Test @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a") - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "v") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "x") public void testEmailConstraint() { Validator validator = TestUtil.getValidatorUnderTest(); EmailDummyEntity foo = new EmailDummyEntity(); @@ -65,7 +65,7 @@ public void testEmailConstraint() { @Test @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a") - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "v") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "x") public void testEmailConstraintOnStringBuilder() { // @Email has to support CharSequence so let's also try a StringBuilder Validator validator = TestUtil.getValidatorUnderTest(); diff --git a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/FuturePastConstraintsTest.java b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/FuturePastConstraintsTest.java index cc12cb5b..875cbdbd 100644 --- a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/FuturePastConstraintsTest.java +++ b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/FuturePastConstraintsTest.java @@ -162,7 +162,7 @@ public void testPastConstraintForRelativePartial() { @Test @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a") - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "s") public void testFutureConstraint() { Validator validator = TestUtil.getValidatorUnderTest(); FutureDummyEntity dummy = new FutureDummyEntity(); @@ -215,7 +215,7 @@ public void testFutureConstraint() { @Test @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a") - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "s") public void testFutureConstraintForRelativePartial() { // For partials not referencing a precise point in time, we need to use the FixedClockProvider // to make sure the tests are working at any date @@ -254,7 +254,7 @@ public void testFutureConstraintForRelativePartial() { } @Test - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "q") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r") public void testPastOrPresentConstraint() { ZonedDateTime reference = ZonedDateTime.of( 2016, 6, 6, 14, 26, 0, 0, TZ_BERLIN ); @@ -344,7 +344,7 @@ public void testPastOrPresentConstraint() { } @Test - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "q") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r") public void testPastOrPresentConstraintForRelativePartial() { ZonedDateTime reference = ZonedDateTime.of( 2016, 6, 6, 14, 26, 0, 0, TZ_BERLIN ); @@ -394,7 +394,7 @@ public void testPastOrPresentConstraintForRelativePartial() { } @Test - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "t") public void testFutureOrPresentConstraint() { ZonedDateTime reference = ZonedDateTime.of( 2016, 6, 6, 14, 26, 0, 0, TZ_BERLIN ); @@ -484,7 +484,7 @@ public void testFutureOrPresentConstraint() { } @Test - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "t") public void testFutureOrPresentConstraintForRelativePartial() { ZonedDateTime reference = ZonedDateTime.of( 2016, 6, 6, 14, 26, 0, 0, TZ_BERLIN ); diff --git a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/NotBlankConstraintTest.java b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/NotBlankConstraintTest.java index 3f3e5c3f..222e54e0 100644 --- a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/NotBlankConstraintTest.java +++ b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/NotBlankConstraintTest.java @@ -42,7 +42,7 @@ public static WebArchive createTestArchive() { @Test @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a") - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "u") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "w") public void testNotBlankConstraint() { Validator validator = getValidator(); NotBlankDummyEntity foo = new NotBlankDummyEntity(); @@ -93,7 +93,7 @@ public void testNotBlankConstraint() { @Test @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a") - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "u") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "w") public void testNotBlankConstraintOnStringBuilder() { // @NotBlank has to support CharSequence so let's also try a StringBuilder Validator validator = getValidator(); diff --git a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/NotEmptyConstraintTest.java b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/NotEmptyConstraintTest.java index 2d97fb41..19e22d29 100644 --- a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/NotEmptyConstraintTest.java +++ b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/NotEmptyConstraintTest.java @@ -47,7 +47,7 @@ public static WebArchive createTestArchive() { @Test @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a") - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "t") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "v") public void testNotEmptyConstraint() { Validator validator = TestUtil.getValidatorUnderTest(); NotEmptyDummyEntity dummy = new NotEmptyDummyEntity(); diff --git a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/PatternConstraintTest.java b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/PatternConstraintTest.java index 3518007d..a32fe3d3 100644 --- a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/PatternConstraintTest.java +++ b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/builtinconstraints/PatternConstraintTest.java @@ -42,7 +42,7 @@ public static WebArchive createTestArchive() { @Test @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a") - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "s") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "u") public void testPatternConstraint() { Validator validator = TestUtil.getValidatorUnderTest(); PatternDummyEntity dummy = new PatternDummyEntity(); diff --git a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/ContainerElementTypeDescriptorTest.java b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/ContainerElementTypeDescriptorTest.java index ebf8c579..4246e8b9 100644 --- a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/ContainerElementTypeDescriptorTest.java +++ b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/ContainerElementTypeDescriptorTest.java @@ -66,8 +66,8 @@ public static WebArchive createTestArchive() { @Test @SpecAssertion(section = Sections.CONSTRAINTMETADATA_ELEMENTDESCRIPTOR, id = "a") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "a") - @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "b") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "c") + @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "d") public void testGetContainerElementMetaDataForRoles() { PropertyDescriptor descriptor = getPropertyDescriptor( EmployeeImpl.class, "roles" ); @@ -93,8 +93,8 @@ public void testGetContainerElementMetaDataForRoles() { @Test @SpecAssertion(section = Sections.CONSTRAINTMETADATA_ELEMENTDESCRIPTOR, id = "a") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "a") - @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "b") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "c") + @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "d") public void testGetContainerElementMetaDataForDivision() { PropertyDescriptor descriptor = getPropertyDescriptor( EmployeeImpl.class, "division" ); @@ -113,8 +113,8 @@ public void testGetContainerElementMetaDataForDivision() { @Test @SpecAssertion(section = Sections.CONSTRAINTMETADATA_ELEMENTDESCRIPTOR, id = "a") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "a") - @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "b") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "c") + @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "d") public void testGetContainerElementMetaDataForColleagues() { PropertyDescriptor descriptor = getPropertyDescriptor( EmployeeImpl.class, "colleagues" ); @@ -133,8 +133,8 @@ public void testGetContainerElementMetaDataForColleagues() { @Test @SpecAssertion(section = Sections.CONSTRAINTMETADATA_ELEMENTDESCRIPTOR, id = "a") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "a") - @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "b") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "c") + @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "d") public void testGetContainerElementMetaDataForAddresses() { PropertyDescriptor descriptor = getPropertyDescriptor( EmployeeImpl.class, "addresses" ); diff --git a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/ParameterDescriptorTest.java b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/ParameterDescriptorTest.java index 4ed37ab9..2d66ad07 100644 --- a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/ParameterDescriptorTest.java +++ b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/ParameterDescriptorTest.java @@ -216,8 +216,8 @@ public void testGetGroupConversionsReturnsEmptySetForMethodParameter() { @Test @SpecAssertion(section = Sections.CONSTRAINTMETADATA_ELEMENTDESCRIPTOR, id = "a") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "a") - @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "b") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "c") + @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "d") public void testGetContainerElementMetaDataForMethodParameter() { ParameterDescriptor parameterDescriptor = Executables.parameterWithCascadedContainerElements().getParameterDescriptors().get( 1 ); @@ -227,8 +227,9 @@ public void testGetContainerElementMetaDataForMethodParameter() { @Test @SpecAssertion(section = Sections.CONSTRAINTMETADATA_ELEMENTDESCRIPTOR, id = "a") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "a") - @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "b") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "c") + @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "d") + @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "e") public void testGetContainerElementMetaDataForConstructorParameter() { ParameterDescriptor parameterDescriptor = Executables.constructorWithCascadedContainerElementsOnParameter().getParameterDescriptors().get( 0 ); diff --git a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/PropertyDescriptorTest.java b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/PropertyDescriptorTest.java index e50a7828..520f0876 100644 --- a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/PropertyDescriptorTest.java +++ b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/PropertyDescriptorTest.java @@ -152,8 +152,9 @@ public void testGetGroupConversionsReturnsEmptySet() { @Test @SpecAssertion(section = Sections.CONSTRAINTMETADATA_ELEMENTDESCRIPTOR, id = "a") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "a") - @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "b") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "c") + @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "d") + @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "e") public void testGetContainerElementMetaData() { PropertyDescriptor descriptor = getPropertyDescriptor( ComplexOrder.class, "orderLines" ); diff --git a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/ReturnValueDescriptorTest.java b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/ReturnValueDescriptorTest.java index 5b3c1a2b..b14fb3fa 100644 --- a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/ReturnValueDescriptorTest.java +++ b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/metadata/ReturnValueDescriptorTest.java @@ -192,8 +192,9 @@ public void testGetGroupConversionsReturnsEmptySetForMethodReturnValue() { @Test @SpecAssertion(section = Sections.CONSTRAINTMETADATA_ELEMENTDESCRIPTOR, id = "a") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "a") - @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "b") @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "c") + @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "d") + @SpecAssertion(section = Sections.CONSTRAINTMETADATA_CONTAINERDESCRIPTOR, id = "e") public void testGetContainerElementMetaDataForReturnValue() { ReturnValueDescriptor returnValueDescriptor = Executables.returnValueWithCascadedContainerElements().getReturnValueDescriptor(); diff --git a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/time/ClockProviderFutureTest.java b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/time/ClockProviderFutureTest.java index 1df39071..bc0daa61 100644 --- a/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/time/ClockProviderFutureTest.java +++ b/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/time/ClockProviderFutureTest.java @@ -45,7 +45,7 @@ public static WebArchive createTestArchive() { } @Test - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "s") public void clockProviderIsUsed() { FutureDummyEntity dummy = new FutureDummyEntity( ZonedDateTime.of( 2099, 1, 12, 5, 0, 0, 0, TZ_BERLIN ) ); @@ -97,7 +97,7 @@ public void clockProviderIsUsed() { } @Test - @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r") + @SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "s") public void clockProviderIsUsedForRelativePartials() { FutureRelativePartialDummyEntity dummy = new FutureRelativePartialDummyEntity( ZonedDateTime.of( 2016, 6, 6, 14, 45, 0, 0, TZ_BERLIN ) ); diff --git a/tests/src/main/resources/tck-audit.xml b/tests/src/main/resources/tck-audit.xml index 8ddd884b..1b693d92 100644 --- a/tests/src/main/resources/tck-audit.xml +++ b/tests/src/main/resources/tck-audit.xml @@ -7,7 +7,7 @@ See the license.txt file in the root directory or . --> - +
@@ -306,7 +306,7 @@
- Constraint validators for temporal constraints (either the built-in constraints @Past and @Future or custom temporal constraints) can obtain the current instant from the ClockProvider object exposed by ConstraintValidatorContext#getClockProvider(). + Constraint validators for temporal constraints (either the built-in constraints @Past, @PastOrPresent, @Future and @FutureOrPresent or custom temporal constraints) can obtain the current instant from the ClockProvider object exposed by ConstraintValidatorContext#getClockProvider(). The getClock() method returns a java.time.Clock object which represents the current instant, date and time using a time zone. A conforming Bean Validation implementation provides a default clock provider which returns a clock representing the current system time and default time zone. @@ -375,7 +375,7 @@ For generic container types (e.g. java.util.List), @ExtractedValue is to be specified on a type argument of the container type as used in the extractor definition. - Only wildcard type arguments are supported as target for @ExtractedValue in this case. + Only unbounded wildcard type arguments are supported as target for @ExtractedValue in this case. For non-generic container types (e.g. java.util.OptionalInt), @ExtractedValue is to be specified on the container type as used in the extractor definition. The type of the wrapped element(s) must be specified using @ExtractedValue#type() in this case. @@ -387,7 +387,7 @@
- This causes constraints to be automatically applied to the wrapped value if a constraint is found for an element handled by that extractor + This causes constraints to be automatically applied to the wrapped value(s) if a constraint is found for an element of a type handled by that extractor
@@ -521,6 +521,12 @@ The @Valid annotation is applied recursively. + + It is not supported to put @Valid to the type parameters of generic types or methods. + + + It is also not supported to put @Valid to type arguments within the extends or implements clauses of type definitions. +
@@ -702,7 +708,7 @@ Container element constraints can be used within the following declarations: fields, properties, method or constructor parameters or method return values. - When a field, property, executable parameter or method return value which is of a container type gets validated, then all values contained in the container will be validated provided that their container element is constrained. + When a field, property, executable parameter or method return value which is of a container type gets validated, then all values contained in the container will be validated provided that their container element type is constrained. Any container element constraints of that element will be validated alongside any other constraints hosted by that element. @@ -714,7 +720,10 @@ Container element constraints can be applied to nested container types - Container element constraints are not supported on wildcard type arguments (with or without bounds), i.e. the following usage is unsupported + It is not supported to declare container element constraints on the type parameters of generic types or methods. + + + It is also not supported to declare container element constraints on type arguments within the extends or implements clauses of type definitions.
@@ -921,7 +930,7 @@ If the constraint is hosted on a method or constructor parameter, the parameter type is the targeted type. - If the constraint is hosted on a type argument of a generic type (i.e. a container element constraint, see 5.5), the type argument's type is the targeted type. + If the constraint is hosted on a type argument of a parameterized type (i.e. a container element constraint, see 5.5), the type argument's type is the targeted type. If the constraint is subject to implicit unwrapping (see 5.5.1) and the applicable value extractor is defined for a generic type (e.g. javafx.beans.value.ObservableValue), the targeted type is the type captured for the type parameter handled by the value extractor (e.g. String if the constraint is placed on a StringProperty). @@ -1008,7 +1017,7 @@ If more than one maximally specific and container-element-compliant ValueExtractor is found, a ConstraintDeclarationException is raised.
-
+
If the constraint carries the Unwrapping.Skip payload, no value extractor is applied. @@ -1182,13 +1191,13 @@ getName() returns the name of the element which the node represents - isInIterable() returns true if the node represents an object contained in an array, Iterable or in a Map, false otherwise. + isInIterable() returns true if the node represents an object contained in an array or in a multi-valued container such as Iterable or Map, false otherwise. - getIndex() returns the index of the node if it is contained in an array or List. Returns null otherwise. + getIndex() returns the index of the node if it is contained in an array, List or any other container supporting indexed access. Returns null otherwise. - getKey() returns the key of the node if it is contained in a Map. Returns null otherwise. + getKey() returns the key of the node if it is contained in a Map or any other container supporting keyed access. Returns null otherwise. getKind() returns the ElementKind corresponding to the actual node type. This can be used in conjunction with the method as() to narrow the type and access node specific methods @@ -1689,7 +1698,7 @@
- getElementClass() returns the object type when invoked on BeanDescriptor, the type of a property or parameter when invoked on PropertyDescriptor or ParameterDescriptor respectively, Object[].class when invoked on CrossParameterDescriptor, the return type when invoked on ConstructorDescriptor, MethodDescriptor or ReturnValueDescriptor. + getElementClass() returns the object type when invoked on BeanDescriptor, the type of a property or parameter when invoked on PropertyDescriptor or ParameterDescriptor respectively, Object[].class when invoked on CrossParameterDescriptor, the return type when invoked on ConstructorDescriptor, MethodDescriptor or ReturnValueDescriptor, the container element type when invoked on ContainerElementTypeDescriptor (e.g. when invoked on a descriptor representing the container element type of List<String>, String.class will be returned). getConstraintDescriptors() returns all the ConstraintDescriptors (see 7.12) hosted on the given element in the class hierarchy, each ConstraintDescriptor describing one of the constraints declared on the given element. @@ -1809,14 +1818,20 @@
- getContainerElementTypes() returns a list of descriptors representing all the type arguments of the container type, in the order of their declaration. + If a given element is of a container type, getConstrainedContainerElementTypes() returns a set with descriptors representing those container element types that either host at least one constraint or are marked with @Valid. - The ContainerElementTypeDescriptor interface describes the potential container element constraints applied to one type argument of a container type. + The returned set will be empty if the given element is not of a container type or is of a container type but has no element types that are constrained or marked with @Valid. + The ContainerElementTypeDescriptor interface describes the potential container element constraints applied to one element type of a container. + + getTypeArgumentIndex() returns the index of the type argument corresponding to this descriptor instance. + + getContainerClass() returns the type of the container declaring the container element type represented by this descriptor instance. +
@@ -1926,18 +1941,24 @@ @Past constraint - @Future constraint + @PastOrPresent constraint - @Pattern constraint + @Future constraint - @NotEmpty constraint + @FutureOrPresent constraint - @NotBlank constraint + @Pattern constraint + @NotEmpty constraint + + + @NotBlank constraint + + @Email constraint
@@ -2154,7 +2175,7 @@
- For applying constraints to the elements of generic container types or marking them for cascaded validation, the container-element-type element is used. + To apply constraints to the elements of generic container types or marking them for cascaded validation, the container-element-type element is used. container-element-type can be used within the field, getter, parameter and return-value elements. @@ -2166,7 +2187,7 @@ The type-argument-index can be omitted, if the container element type has exactly one type argument. - The ignore-annotations settings effectively applying for the encapsulating element (field, getter etc.) are applied for container-element-type, too. + The ignore-annotations settings effectively applying to the encapsulating element (field, getter etc.) are applied to container-element-type, too. The container-element-type element can be nested for configuring nested generic containers such as List<List<String>>. @@ -2316,7 +2337,7 @@
- Every (runtime) exception raised either at initialization time or execution time by any of the extension interfaces (ConstraintValidator, ConstraintValidatorFactory, MessageInterpolator, TraversableResolver, ValidationProviderResolver, ParameterNameProvider, ClockProvider) is wrapped in a ValidationException. + Every (runtime) exception raised either at initialization time or execution time by any of the extension interfaces (ConstraintValidator, ConstraintValidatorFactory, MessageInterpolator, TraversableResolver, ValidationProviderResolver, ParameterNameProvider, ClockProvider, ValueExtractor) is wrapped in a ValidationException.