commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: [NET] Designing a Date Format-aware FTP Entry Parser
Date Wed, 29 Sep 2004 06:04:20 GMT
Steve Cohen wrote:

>If you think that I meant for the user to pass in FTPDateFormat objects, you 
>misunderstood me. The paradigm I want to use here is passing in strings.  
>  
>
No, i got it. But maybe we could do it like the FTPFileEntryParser do? 
Try to determine if the use passed a FQCN else treat it as date/locale 
string.

>For the Ant client 
>task it is much easier to assemble the strings and construct the needed 
>objects ourselves, than it is to make the user do it.
>  
>
This is why i created in VFS a 
o.a..c.v.u.DelegatingFileSystemOptionsBuilder (again a long name ;-).
I dont wanted to maintain two methods for each possible configuration 
setting - one with a string as parameter and another with the real class 
type.

This class is responsible to get a configuration-key-name and its value 
as string.
It tries to lookup the targeted configuration-methods (by the key name) 
parsers its method parameters and tries to find a way to convert the 
string to the desired type.
This is done by lookup a
*) constructor with only one String as parameter
*) static valueOf(String) method
on the targeted object.

I think this is a nice glue between configuration-by-string (as in ant) 
and configuration-by-code where i would like to have compile time checks.
 
But for sure, this might go too far just for the date/locale setting.

---
Mario


---------------------------------------------------------------------
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