<div dir="ltr">2013/1/18 Emmanuel Bernard <span dir="ltr">&lt;<a href="mailto:emmanuel@hibernate.org" target="_blank">emmanuel@hibernate.org</a>&gt;</span><br><div class="gmail_extra"><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">
It looks like you added ingore-annotation at the param/return value<br>
level out of real-life feedback. Can yuo share your thoughts on this.<br></blockquote><div><br></div><div style>I added &quot;ignore-annotations&quot; to the new elements mainly due to consistency reasons. As of BV 1.0 it&#39;s already there for the &quot;field&quot; and &quot;getter&quot; elements, so I think it makes sense to have it on the new ones as well.</div>
<div style><br></div><div style>One could think about having it on &quot;method&quot; only. But then, if you have a method with parameter and return value constraint annotations and want (only) to disable the return value constraints in XML, you&#39;d have to re-specify all the parameter constraints.</div>
<div> </div><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">
Does the current XSD use the camel case pattern instead of the dash<br>
separated pattern? Ideally, I&#39;d rather have<br>
<br>
    &lt;convert-group/&gt;<br></blockquote><div><br></div><div style>Good point, the 1.0 type names (which are not visible to the reader of an instance document) are (mostly) camel case, while the actual element/attribute names are dash separated. It makes sense to follow that pattern, I&#39;ll update the names.</div>
<div> </div><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">
Group conversion can happen on regular properties, is that covered?<br></blockquote><div><br></div><div style>Yes, that&#39;s available on &quot;field&quot;, &quot;getter&quot;, &quot;parameter&quot; and &quot;returnValue&quot;/&quot;return-value&quot;.</div>
<div> </div><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">
I&#39;m a bit uneasy with your idea of getter vs method. That means the<br>
getter element (isn&#39;t it named property?) has all the enhancements you<br>
are describing correct?</blockquote><div><br></div><div style>The &quot;getter&quot; element has a new optional sub-element, &quot;convertGroup&quot;/&quot;convert-group&quot;, that&#39;s the changes to it.</div><div style>
<br></div><div style>As of 1.0, &quot;A given field or getter must not be described more
    than once on a given class description.&quot; I think defining a &quot;getter&quot; and a &quot;method&quot; element falls into the same category, so I think we should throw a ValidationException in that case, too.</div>
<div> <br></div><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"> In other words, can you dive a bit in the<br>

subject.<br></blockquote><div><br></div><div style>I&#39;ve done the following changes/additions:</div><div style><br></div><div style>* Added sub-element &quot;convertGroup&quot; [0..unbounded] to the &quot;field&quot; and &quot;getter&quot; elements<br>
</div><div style>* Added elements &quot;constructor&quot; and &quot;method&quot; [0..unbounded] to the &quot;bean&quot; element</div><div style>* The &quot;method&quot; element has the sub-elements &quot;parameter&quot; [0..unbounded], &quot;returnValue&quot; [0..1] and &quot;crossParameterConstraint&quot; [0..unbounded]; &quot;constructor&quot; is the same without &quot;returnValue&quot;.</div>
<div style>* The &quot;parameter&quot; and &quot;returnValue&quot; elements resemble the &quot;field&quot; and &quot;getter&quot; elements and have sub-elements &quot;valid&quot; [0..1], &quot;constraint&quot; [0..unbounded] and &quot;convertGroup&quot; [0..unbounded] (actually we could extract a common super-type for &quot;field&quot;, &quot;getter&quot;, &quot;parameter&quot; and &quot;returnValue&quot;).</div>
<div style>* With a previous change: added &quot;version&quot; attribute to root element with a fixed value of &quot;1.1&quot;<br></div><div style><br></div><div style>Not sure whether that&#39;s what you were up to; if something needs more clarification let me know. You can compare the draft with the old version at <a href="https://github.com/gunnarmorling/hibernate-validator/compare/HV-373" target="_blank">https://github.com/gunnarmorling/hibernate-validator/compare/HV-373</a>.</div>
<div style><br></div><div style>--Gunnar</div><div> </div><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">

<div class=""><div class="h5"><br>
On Fri 2013-01-18 10:24, Gunnar Morling wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I&#39;ve started to work on a new version of the XSD for constraint mapping<br>
&gt; files in order to allow for the XML-based configuration of<br>
&gt; method/constructor constraints [1] and group conversions [2]. The latest<br>
&gt; XSD draft can be found at [3].<br>
&gt;<br>
&gt; The following shows how the configuration of method constraints and group<br>
&gt; conversions would look like:<br>
&gt;<br>
&gt;     &lt;bean class=&quot;com.acme.MyBean&quot; ignore-annotations=&quot;false&quot;&gt;<br>
&gt;         &lt;method name=&quot;getFirstname&quot; ignore-annotations=&quot;true&quot;&gt;<br>
&gt;             &lt;parameter type=&quot;java.lang.String&quot;&gt;<br>
&gt;                 &lt;constraint<br>
&gt; annotation=&quot;javax.validation.constraints.Pattern&quot;&gt;<br>
&gt;                     &lt;message&gt;Last name has to start with with a capital<br>
&gt; letter.&lt;/message&gt;<br>
&gt;                     &lt;element name=&quot;regexp&quot;&gt;^[A-Z][a-z]+&lt;/element&gt;<br>
&gt;                 &lt;/constraint&gt;<br>
&gt;             &lt;/parameter&gt;<br>
&gt;             &lt;parameter type=&quot;int&quot;&gt;<br>
&gt;                 &lt;valid/&gt;<br>
&gt;                 &lt;constraint annotation=&quot;javax.validation.constraints.Min&quot;&gt;<br>
&gt;                     &lt;element name=&quot;value&quot;&gt;1&lt;/element&gt;<br>
&gt;                 &lt;/constraint&gt;<br>
&gt;                 &lt;convertGroup from=&quot;javax.validation.groups.Default&quot;<br>
&gt; to=&quot;com.acme.Basic&quot;/&gt;<br>
&gt;             &lt;/parameter&gt;<br>
&gt;             &lt;parameter type=&quot;long&quot; ignore-annotations=&quot;false&quot;/&gt;<br>
&gt;             &lt;returnValue&gt;<br>
&gt;                 &lt;valid/&gt;<br>
&gt;                 &lt;constraint<br>
&gt; annotation=&quot;javax.validation.constraints.Pattern&quot;&gt;<br>
&gt;                     &lt;message&gt;Last name has to start with with a capital<br>
&gt; letter.&lt;/message&gt;<br>
&gt;                     &lt;element name=&quot;regexp&quot;&gt;^[A-Z][a-z]+&lt;/element&gt;<br>
&gt;                 &lt;/constraint&gt;<br>
&gt;             &lt;/returnValue&gt;<br>
&gt;             &lt;crossParameterConstraint<br>
&gt; annotation=&quot;com.acme.MyCrossParameterConstraint&quot;/&gt;<br>
&gt;         &lt;/method&gt;<br>
&gt;     &lt;/bean&gt;<br>
&gt;<br>
&gt; I tried to follow the existing style and patterns. Some notes:<br>
&gt;<br>
&gt; * Always all the parameters of an executable must be specified in order to<br>
&gt; identify overloaded executables, also if the configuration of a particular<br>
&gt; parameter shall remain unchanged (ignore-annotations=&quot;false&quot; is to be used<br>
&gt; in this case).<br>
&gt; * ignore-annotations on methods/constructors overrides ignore-annotations<br>
&gt; on the bean level; ignore-annotations on parameters/return values overrides<br>
&gt; ignore-annotations on the method/constructor and bean levels<br>
&gt; * parameters are identified by their type. The FQN of the type is to be<br>
&gt; used (taking &quot;default-package&quot; into account), or &quot;int&quot;, &quot;long&quot; etc. for<br>
&gt; primitive types.<br>
&gt; * A getter method must either be configured using the &quot;getter&quot; or the<br>
&gt; &quot;method&quot; element. If both are given for one and the same getter, a<br>
&gt; ValidationException will be thrown.<br>
&gt;<br>
&gt; Is there anything else we should add or consider? If there are no<br>
&gt; objections, I&#39;ll move forward with adapting the spec next week.<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; --Gunnar<br>
&gt;<br>
&gt; [1] <a href="https://hibernate.onjira.com/browse/BVAL-273" target="_blank">https://hibernate.onjira.com/browse/BVAL-273</a><br>
&gt; [2] <a href="https://hibernate.onjira.com/browse/BVAL-333" target="_blank">https://hibernate.onjira.com/browse/BVAL-333</a><br>
&gt; [3] <a href="https://github.com/gunnarmorling/hibernate-validator/compare/HV-373" target="_blank">https://github.com/gunnarmorling/hibernate-validator/compare/HV-373</a><br>
<br>
</div></div><div class=""><div class="h5">&gt; _______________________________________________<br>
&gt; beanvalidation-dev mailing list<br>
&gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
<br>
_______________________________________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
</div></div></blockquote></div><br></div></div>