<div dir="ltr"><div class="gmail_extra">2013/1/16 Emmanuel Bernard <span dir="ltr">&lt;<a href="mailto:emmanuel@hibernate.org" target="_blank">emmanuel@hibernate.org</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
The small advantage I find in having two annotations is that it is readable at a glance what the constraint is even just by reading its javadoc (assuming @Documented). In the second approach, you need to explicitly put it in the javadoc or have your users access to the source code and parse the @Constraint</blockquote>
<div><br></div><div style>Which JavaDoc do you mean, the JavaDoc for the definition a constraint annotation type or the JavaDoc for an element annotated with a constraint annotation?</div><div style><br></div><div style>The former contains all meta annotations, including their members, so the type would be recognizable either way. The latter only contains the actual constraint annotation itself (i.e. no meta-annotations) if the constraint is annotated with @Documented. So afaics, from the JavaDoc of a constraint usage site it&#39;s not recognizable whether the constraint is generic or cross-parameter (if it&#39;s not encoded into the name).</div>
<div> </div><div style>Or did you mean something else?</div><div style><br></div><div style>--Gunnar</div></div><br><br></div></div>