Skip to content

Commit

Permalink
BVAL-208 Add @ConvertGroup annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelbernard committed Oct 18, 2012
1 parent 2b36e99 commit 5811e24
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
31 changes: 31 additions & 0 deletions src/main/java/javax/validation/ConvertGroup.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package javax.validation;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Convert group {@code from} to group {@code to} during cascading.
*
* @author Emmanuel Bernard
* @since 1.1
*/
@Target({ TYPE, METHOD, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
public @interface ConvertGroup {
Class<?> from();
Class<?> to();

/**
* Defines several {@code ConvertGroup} annotations
* on the same element
*/
public @interface List {
ConvertGroup[] value();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ interface ConstraintFinder {
/**
* Restrict to the constraints matching a given set of groups for this element
*
* This method respects group sequences and group inheritance (including
* class-level {@code Default} group overriding) but does not return
* {@code ConstraintDescriptor}s in any particular order.
* This method respects group conversion, group sequences
* and group inheritance (including class-level {@code Default} group
* overriding) but does not return {@code ConstraintDescriptor}s
* in any particular order.
* Specifically, ordering of the group sequence is not respected.
*
* @param groups groups targeted
Expand Down

0 comments on commit 5811e24

Please sign in to comment.