<div>
            <div>
                <span>Hi,</span></div><div><span><br></span></div><div><div>It's possible to validate anything which implements CharSequence. As you said&nbsp;the validator implementation should call toString() on the validated data. To&nbsp;do&nbsp;this the validator has to implement ConstraintValidator&lt;WebSafe, CharSequence&gt;&nbsp;and it will be called for any data validated (annotated with WebSafe) which implements&nbsp;CharSequence.</div></div><div><br></div><div><span>--Kevin<br></span>
                
                <p style="color: #a0a0a0;">Le dimanche 12 juin 2011 à 21:31, John D. Ament a écrit :</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div>Would it be possible (and I'm not very familiar with Validations API) for it to validate not just Strings but anything extending CharSequence?&nbsp; I know Jsoup's looking for strings, but couldn't we call toString() on the object passed in?<br>
<br><div>On Sun, Jun 12, 2011 at 11:16 AM, George Gastaldi <span dir="ltr">&lt;<a href="mailto:gegastaldi@gmail.com">gegastaldi@gmail.com</a>&gt;</span> wrote:<br><blockquote type="cite"><div>
Ok, created a new pull request with the proposed changes:<br>
<br>
<a href="https://github.com/hibernate/hibernate-validator/pull/62" target="_blank">https://github.com/hibernate/hibernate-validator/pull/62</a><br>
<br>
Let me know if there is need of something more.<br>
<br>
Regards,<br>
<br>
George<br>
<br>
2011/6/12 Kevin Pollet &lt;<a href="mailto:pollet.kevin@gmail.com">pollet.kevin@gmail.com</a>&gt;:<br>
<div><div>&gt; Hi all,<br>
&gt;<br>
&gt; +1<br>
&gt; I think it's useful to allow customization of the constraint. As said Shane<br>
&gt; the annotation should provide an enum allowing to use all built-in JSoup<br>
&gt; whitelist and allow the user to specify its whitelist implementation.<br>
&gt; --Kevin<br>
&gt;<br>
&gt; Le dimanche 12 juin 2011 à 13:14, Gunnar Morling a écrit :<br>
&gt;<br>
&gt; Hi George,<br>
&gt;<br>
&gt; I added some comments to your pull request.<br>
&gt;<br>
&gt; With respect to Shane's whitelist suggestion you might have a value()<br>
&gt; attribute accepting an enumeration with the standard whitelist<br>
&gt; implementations and alternative attribute Class&lt;? extends Whitelist&gt;<br>
&gt; whiteListClass() which allows to specify custom whitelist classes.<br>
&gt;<br>
&gt; --Gunnar<br>
&gt;<br>
&gt;<br>
&gt; 2011/6/12 George Gastaldi &lt;<a href="mailto:gegastaldi@gmail.com">gegastaldi@gmail.com</a>&gt;:<br>
&gt;<br>
&gt; Cool ideas. Will implement it ASAP<br>
&gt;<br>
&gt; Em 12/06/2011, às 02:06, Shane Bryzak &lt;<a href="mailto:sbryzak@redhat.com">sbryzak@redhat.com</a>&gt; escreveu:<br>
&gt;<br>
&gt; Looks good, although I wouldn't hard code Whitelist.basic() as the<br>
&gt; default... instead I would make Whitelist.relaxed() the default, and then<br>
&gt; perhaps allow the developer to override it by specifying an enum value for<br>
&gt; the validation level allowed on the @WebSafe annotation. &nbsp;E.g:<br>
&gt;<br>
&gt; // Default would use Whitelist.relaxed()<br>
&gt; private @WebSafe String content;<br>
&gt;<br>
&gt; // This would use the basic whitelist<br>
&gt; private @WebSafe(basic) String content;<br>
&gt;<br>
&gt; // Basic whitelist plus images<br>
&gt; private @WebSafe(basicWithImages) String content;<br>
&gt;<br>
&gt; It would even be nice to somehow allow the developer to specify their own<br>
&gt; whitelist, if you can work out an elegant way to implement it.<br>
&gt;<br>
&gt;<br>
&gt; On 12/06/11 12:46, George Gastaldi wrote:<br>
&gt;<br>
&gt; Hey Shane,<br>
&gt;<br>
&gt; I implemented the @WebSafe annotation you mentioned on Hibenate Validator.<br>
&gt; The pull request is <a href="https://github.com/hibernate/hibernate-validator/pull/61" target="_blank">https://github.com/hibernate/hibernate-validator/pull/61</a><br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt; George Gastaldi<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; seam-dev mailing list<br>
&gt; <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
&gt;<br>
&gt;<br>
<br>
_______________________________________________<br>
seam-dev mailing list<br>
<a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
</div></div></div></blockquote></div><br>
</div></div></span>
                
                
                
                
                </blockquote>
                
                <div>
                    <br>
                </div>
            </div>
        </div>