commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (VALIDATOR-256) StringUtils.isText to check in a null safe way if a String has (real) text
Date Wed, 05 Mar 2008 05:23:40 GMT

    [ https://issues.apache.org/jira/browse/VALIDATOR-256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12575235#action_12575235
] 

Henri Yandell commented on VALIDATOR-256:
-----------------------------------------

Sounds like this would be a Validator feature - ie) the ignore-whitespace bit; so moving over
to Validator.

> StringUtils.isText to check in a null safe way if a String has (real) text
> --------------------------------------------------------------------------
>
>                 Key: VALIDATOR-256
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-256
>             Project: Commons Validator
>          Issue Type: Improvement
>            Reporter: Jörg Gottschling
>            Priority: Minor
>
> I used something similar from the Spring Framework and it was useful. I suggest two methods
where the second is a little more advanced then theirs.
> First a method StringUtils.isText(String text) : boolean which checks if the String is
not null and contains a least one not whitespace character. (In Spring it's "hasText", but
"isText" seams to be more consistent within commons lang.)
> The second method could be StringUtils.isText(String text, int n) : boolean which checks
if the String is not null and contains a least n not whitespace characters.
> Question: What happens if a (stupid ;-) developer checks for -5 characters? I think it
should throw an IllegalArgumentException.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message