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 34099] - [configuration] Use beanutils for conversions
Date Mon, 21 Mar 2005 13:45:59 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=34099>.
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=34099





------- Additional Comments From ebourg@apache.org  2005-03-21 14:45 -------
Being "non standard" with beanutils is not really an issue, it just means less
code reuse, and some people will argue less dependencies on external libraries.

Your suggestion of a getProperty(String, Class) method is interesting. We tried
to cover most basic types handled in configuration files with the
DataConfiguration class in the 1.1 release, let us know if you feel we forgot an
obvious type. 

Regarding enumerations I think it's easier to use a valueOf method:

MyEnum e = MyEnum.valueOf(config.getString(key));

rather than writing and registering a specific converter for this enumeration:

ConvertUtils.register(new Converter() {
    public Object convert(Class type, Object value) {
        return MyEnum.valueOf(String.valueOf(value));
    }    
}, MyEnum.class);

MyEnum e = (MyEnum) config.getProperty(key, MyEnum);



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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