commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31568] New: - ConvertUtilsBean: register converter for specific property
Date Wed, 06 Oct 2004 20:20:24 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31568>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31568

ConvertUtilsBean: register converter for specific property

           Summary: ConvertUtilsBean: register converter for specific
                    property
           Product: Commons
           Version: 1.5 Final
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Bean Utilities
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: michael@schuerig.de


Currently, converters are selected only based on the class to which they 
convert objects. In general this works pretty well, but I've encountered 
cases, where this doesn't work out.  
 
For example, I'm using java.util.Date objects to represent points and 
intervals in time that are not completely specific, such as day of the week 
and month. Now I can easily write a Converter that uses SimpleDateFormat to 
convert string representations of these dates ("Mon", "Feb") to Date objects.  
 
When I register one of these converters with ConvertUtils(Bean), though, it 
preempts any conversion to Date. Something I clearly don't want as I have to 
deal with different kinds of dates. 
 
As a solution, I'd like to be able to register a converter for a specific 
property of a bean class, with a method this 
 
ConvertUtilsBean#register(Converter converter, java.lang.Class 
destinationClass, java.lang.Class beanClass, java.lang.String propertyName) 
 
Michael

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


Mime
View raw message