<p><br>
Am 30.06.2012 13:46 schrieb "Gerhard Petracek" <<a href="mailto:gerhard.petracek@gmail.com">gerhard.petracek@gmail.com</a>>:<br>
><br>
> hi hardy,<br>
><br>
> thx for moving it to an own thread!<br>
><br>
> a copy of my last answer:<br>
><br>
> ...<br>
> it's just about:<br>
> - an interface which directly allows simple but still flexible custom implementations of (custom) message-sources (including a simple delegation to a ResourceBundle) - see [1].<br>
> vs.<br>
> - an interface which is restricted to ResourceBundle. -> if it isn't possible to use ListResourceBundle or PropertyResourceBundle, users have to implement #getKeys which might not be possible (/ that easy) for some advanced use-cases.<br>
></p>
<p>What's that 2nd interface required for? Wouldn't it suffice to do all lookups via the first interface and demand in the spec, that the default implementation of that interface returns values based on the ValidationMessages bundle?</p>
<p>What are the advanced use cases you have in mind?</p>
<p>> the rest is more or less the same - if the MessageInterpolator receives a key, it uses the new interface for the lookup (if there is no custom implementation of the new interface or no result for the given key, the existing default bundle (ValidationMessages) is used as a fallback).</p>
<p>Sounds reasonable to me. We should expose the default implementation of the interface during bootstrap so that custom implementations can also delegate to it.</p>
<p>><br>
> regards,<br>
> gerhard<br>
></p>
<p>--Gunnar</p>
<p>> [1] <a href="https://svn.apache.org/repos/asf/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/MessageResolver.java">https://svn.apache.org/repos/asf/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/MessageResolver.java</a><br>
><br>
><br>
> 2012/6/26 Hardy Ferentschik <<a href="mailto:hardy@hibernate.org">hardy@hibernate.org</a>><br>
>><br>
>><br>
>> On Jun 26, 2012, at 8:21 AM, Gunnar Morling wrote:<br>
>><br>
>> > I thin I've not yet totally understood what you have in mind.<br>
>><br>
>> AFAIU Gerhard proposes a more general interface which is independent from ResourceBundles. Underneath you still can use them, in fact you would have to for<br>
>> ValidationMessages.properties. We would have to to define the MessageResolver interface and then also define that the default implementation of this interface<br>
>> resolves against ValidationMessages.properties. Even with the ResourceBundleLocator interface you need to somehow specify that a default implementation exists<br>
>> which uses ValidationMessages.properties. Is this what you have in mind Gerhard?<br>
>><br>
>> > Maybe you could create a proposal for BVAL-217 describing things more in detail (interaction between resolver and interpolator, integration with BV 1.0 interpolators etc.)?<br>
>><br>
>> +1 That would be the best.<br>
>><br>
>><br>
>> > I also think using resource bundles is not totally optional as there is the ValidationMessages bundle.<br>
>><br>
>> Right. For that reason using ResourceBundleLocator still feels a little more "natural" to me.<br>
>><br>
>> --Hardy<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">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
><br>
><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">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
><br>
</p>