A mechanism to pass parameters to TypeConverters
------------------------------------------------

                 Key: STS-297
                 URL: http://mc4j.org/jira/browse/STS-297
             Project: Stripes
          Issue Type: New Feature
          Components: Validation
            Reporter: Andy
         Assigned To: Tim Fennell


The canonical example is the ability to have a BigDecimal type converter that 
will automatically truncate the number down to the required scale.  For 
example, you might want to be able to write something like:

@Validate([EMAIL PROTECTED](name="scale" value="2") BigDecimal dollarAmount;
@Validate([EMAIL PROTECTED](name="scale" value="0") BigDecimal liraAmount;

I don't particularly like the syntax that I've written above, but it would need 
to be something flexible since each converter make take a different set of 
parameters.  Also, might need to deal with type issues - the parameter above is 
obviously a number but the value is expressed as a string.  Perhaps it could 
work with:

@Param(name="foo", [numValue=N|stringValue="N"|etc.]?

Also would need to figure out how to make the type converter aware of these 
parameters.  Do we try to inject them using setters?  Or just pass across a map 
of key/value pairs?


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

        

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to