You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Niall Pemberton (JIRA)" <ji...@apache.org> on 2006/07/19 15:22:32 UTC

[jira] Updated: (VALIDATOR-170) [validator] Validating Arrays of simple Objects

     [ http://issues.apache.org/jira/browse/VALIDATOR-170?page=all ]

Niall Pemberton updated VALIDATOR-170:
--------------------------------------

    Component/s: Framework

> [validator] Validating Arrays of simple Objects
> -----------------------------------------------
>
>                 Key: VALIDATOR-170
>                 URL: http://issues.apache.org/jira/browse/VALIDATOR-170
>             Project: Commons Validator
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: 1.3.0 Release
>         Environment: Operating System: Windows 2000
> Platform: PC
>            Reporter: William Ferguson
>            Priority: Minor
>
> The Validator needs the ability to validate an array of simple Objects such as 
> Strings. Ie it should be possible to define a bean like:
> class foo {
>   public String getBar();
>   public void setBar(String[] values);
> }
> and have the values of Bar validated.
> Currently (validator 1.1.3 as ships with Struts 1.2.8, and looks same in 1.1.4), 
> to validate an array of properties you need to specify
>   property='somePropertyName'
>   indexedListProperty='propertyAtWhichCollectionIsFound'
> This will iterate through the collection found at
> 'propertyAtWhichCollectionisFound',
> and will validate the 'somePropertyName' property on each element.
> But if it is a collection of Strings then there is no valid property name to define.
> Ie you don't seem to be able to validate a collection of Strings.
> To fix it, either 'property' needs to be optional (not recommended), or a new
> approach to indexed properties needs to be taken. Perhaps by allowing 'property' 
> to define where the array of values can be found as well as any property to 
> validate on the elements (using dot notation), and having the Validator 
> introspect the values at each step and determine whether ot needs to iterate
> over a collection. This would also solve some of the enhancements requests
> that have been made for the Validator.

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org