[hibernate-issues] [Hibernate-JIRA] Resolved: (HV-35) Add a "trim" attribute to @NotEmpty

Hardy Ferentschik (JIRA) noreply at atlassian.com
Tue Aug 19 12:21:38 EDT 2008


     [ http://opensource.atlassian.com/projects/hibernate/browse/HV-35?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hardy Ferentschik resolved HV-35.
---------------------------------

    Resolution: Rejected

Adding a trim parameter might make it hard to integrate Hibernate Validator with the Bean Validation. Instead we could at a later stage add a new annotation, eg @NotEmptyTrimmed . 

Or one could use a combination of @NotEmpty and @Pattern(regex="(?!^[\s]*$)"). 

> Add a "trim" attribute to @NotEmpty
> -----------------------------------
>
>                 Key: HV-35
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-35
>             Project: Hibernate Validator
>          Issue Type: New Feature
>          Components: validators
>    Affects Versions: 3.0.0.ga
>            Reporter: Mike Youngstrom
>            Assignee: Hardy Ferentschik
>             Fix For: 3.1.0.CR2
>
>         Attachments: validator-allchanges.patch, validator-NotEmpty-trimcapability.patch, validator-patch-HV-35-R2.patch
>
>
> Frequently where an empty string is invalid so would " " be invalid.  I think  trim attribute added to @NotEmpty(trim=true) would be a simple and useful addition.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list