commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Strachan <james_strac...@yahoo.co.uk>
Subject Re: cvs commit: jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/expression ClassNameExpression.java
Date Mon, 07 Apr 2003 16:07:40 GMT

On Monday, April 7, 2003, at 04:59 PM, robert burrell donkin wrote:

> hi james
>
> On Thursday, March 20, 2003, at 07:29 PM, jstrachan@apache.org wrote:
>
>> jstrachan    2003/03/20 11:29:07
>>
>>   Modified:    betwixt/src/java/org/apache/commons/betwixt/io
>>                         BeanRuleSet.java BeanCreateRule.java
>>   Added:       betwixt/src/test/org/apache/commons/betwixt/derived
>>                         EmployeeBean.java PersonListBean.java
>>                         TestDerived.java PersonBean.java 
>> person-list.xml
>>                         ManagerBean.java
>>                betwixt/src/java/org/apache/commons/betwixt/expression
>>                         ClassNameExpression.java
>>   Log:
>>   Added provisional support to allow bean types to be customized by 
>> the presence of a 'className' attribute.
>>
>>   Its fairly simple and only works for parsing of beans right now. We 
>> need to add this customization feature to the ElementDescriptors so 
>> that this can be enabled as required and
>>   then used to auto-default an AttributeDescriptor with a 
>> ClassNameExpression so that the output of the bean will also convey 
>> the className attribute again.
>>
>>   Also the attribute used to describe the class name should be 
>> configurable.
>
> just so i'm clear, this means that an attribute of the xml being 
> parsed is used to specify the class to be constructed, right?
>
> so what we'd need to do to make it configurable is to add another 
> attribute to the .betwixt file that allows the attribute to use to be 
> specfied.

Yes.


>>   Maybe we should default it to 'class' since its rare to ever get a 
>> bean with a 'class' setter property?
>
> i think that sounds pretty reasonable.

Cool.

> <snip>
>
>>   +
>>   +                /**
>>   +                 * @todo this is a duplicate of the code in 
>> BeanCreateRule
>>   +                 * we should try refactor to some common place
>>   +                 */
>>                    if ( matchIDs ) {
>>                        String idref = attributes.getValue( "idref" );
>>                        if ( idref != null ) {
>
> this code is almost identical since i deprecated BeanCreateRule in 
> favour of this new class. BeanRuleSet is a replacement which is more 
> digester friendly. it has been carefully structured so that you can 
> safely add a BeanRuleSet for a bean and then more digester rules for 
> other bits and pieces.

Cool

> BTW i've been adding new fixtures and bug fixes to the list at the 
> bottom of xdocs/tasks.xml

Great. I'll take a peek.

James
-------
http://radio.weblogs.com/0112098/


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