commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Libbrecht <p...@activemath.org>
Subject Re: [betwixt,jelly,beanutils] - Handling java.awt.Point, Dimension and KeyStroke
Date Thu, 11 Mar 2004 09:33:21 GMT
We had a similar problem with Jelly and I remember we have crafted the 
notion of "converters" to convert strings to Point, DebugGraphics, 
Dimension, and Color. None yet for KeyStroke but that could be easily 
solved, I remember it became hard when we wanted Font...

I think the issue was that these converters should be living at the 
level of BeanUtils, having a notion of "converter-context". Robert, 
didn't you mention that there was something changing in this area on 
the BeanUtils side after your jaxme efforts ?

thanks

paul

On 10-Mar-04, at 23:12 Uhr, robert burrell donkin wrote:
> betwixt is bean-centric. it's support for other types is pretty basic 
> at the moment (i'm afraid). i don't know of any way to do this in 
> betwixt at the moment.
>
> but this is a pretty common use case so there's a chance that 
> something like this could get implemented sooner rather than later. 
> i'll have a think about the design.
>
> - robert
>
> On 10 Mar 2004, at 21:25, Smith, Pamela wrote:
>
>> I have a bean with properties whose types are non bean compliant Java 
>> classes -- java.awt.Point, java.awt.Dimension and java.awt.KeyStroke. 
>>  The xml is written correctly, but after parsing, the resulting 
>> instances don't have the right values since Point, Dimension and 
>> KeyStroke are not beans.
>>
>> Has anyone already solved this problem?
>>
>> Thanks,
>> Pam
>>
>> Ex:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>   <Point>
>>     <x>10.0</x>
>>     <y>15.0</y>
>>   </Point>
>>
>>
>> BeanReader reader = new BeanReader();
>> reader.registerBeanClass("Point", java.awt.Point.class);
>> Point p = (Point)reader.parse...
>>
>> The resulting point is not [10,15] since there is no setX() and 
>> setY() on java.awt.Point.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org


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


Mime
View raw message