[xbean-dev] New metadata generator

View: New views
4 Messages — Rating Filter:   Alert me  

[xbean-dev] New metadata generator

by Dain Sundstrom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I checked in new version of the metadata generator based on QDox.  
The new code supports tagging of life cycle methods with:

@org.xbean.InitMethod
@org.xbean.DestroyMethod
@org.xbean.FactoryMethod

I also added support for declaring the nested type of a list, so the  
generated schema and documentation can be more accurate.  When QDox  
gets support for Java5 generics, this will be automatic, but for now  
you can use the following tag:

@org.xbean.Property nestedType="org.xbean.spring.example.PizzaService"

Basically the generator will treat the List as an array of  
PizzaServices.  I still don't think we have collection support down  
yet, and I plan on experiementing in this area more.  If you have  
ideas, please share.

I also stubbed out support for declaring the default value for a  
property, tagging it as required, and specifying a fixed constant  
value.  This will become more useful as we add template support to  
the metadata system (http://docs.codehaus.org/display/XB/Mapping 
+Metadata).

-dain


Re: [xbean-dev] New metadata generator

by jstrachan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Who-hoo!

On 31 Oct 2005, at 20:46, Dain Sundstrom wrote:

> I checked in new version of the metadata generator based on QDox.  
> The new code supports tagging of life cycle methods with:
>
> @org.xbean.InitMethod
> @org.xbean.DestroyMethod
> @org.xbean.FactoryMethod

BTW no biggie but how about using 1 annotation with different  
properties on it? e.g.

@org.xbean.XBean(initMethod="foo", destroyMethod="bar")....

etc?


> I also added support for declaring the nested type of a list, so  
> the generated schema and documentation can be more accurate.  When  
> QDox gets support for Java5 generics, this will be automatic, but  
> for now you can use the following tag:
>
> @org.xbean.Property nestedType="org.xbean.spring.example.PizzaService"
>
> Basically the generator will treat the List as an array of  
> PizzaServices.  I still don't think we have collection support down  
> yet, and I plan on experiementing in this area more.  If you have  
> ideas, please share.
>
> I also stubbed out support for declaring the default value for a  
> property, tagging it as required, and specifying a fixed constant  
> value.  This will become more useful as we add template support to  
> the metadata system (http://docs.codehaus.org/display/XB/Mapping 
> +Metadata).
>
> -dain
>


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


Re: [xbean-dev] New metadata generator

by Dain Sundstrom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Nov 4, 2005, at 4:51 AM, jastrachan@... wrote:

> Who-hoo!
>
> On 31 Oct 2005, at 20:46, Dain Sundstrom wrote:
>
>
>> I checked in new version of the metadata generator based on QDox.  
>> The new code supports tagging of life cycle methods with:
>>
>> @org.xbean.InitMethod
>> @org.xbean.DestroyMethod
>> @org.xbean.FactoryMethod
>>
>
> BTW no biggie but how about using 1 annotation with different  
> properties on it? e.g.
>
> @org.xbean.XBean(initMethod="foo", destroyMethod="bar")....

Well xdoc doesn't support that format, but I'd love for them to add  
it.  If we were, to support this today it would look like this:

   @org.xbean.XBean initMethod="foo" destroyMethod="bar"

Anyway, this kind of comes down to preference.  I like to just tag  
the init and destroy method directly, but it looks you prefer to do  
the annotation on the class.  How about we support both?  We allow  
the user to use one format or the other, but not both.

-dain

Re: [xbean-dev] New metadata generator

by jstrachan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 4 Nov 2005, at 18:21, Dain Sundstrom wrote:

> On Nov 4, 2005, at 4:51 AM, jastrachan@... wrote:
>> Who-hoo!
>>
>> On 31 Oct 2005, at 20:46, Dain Sundstrom wrote:
>>
>>
>>> I checked in new version of the metadata generator based on  
>>> QDox.  The new code supports tagging of life cycle methods with:
>>>
>>> @org.xbean.InitMethod
>>> @org.xbean.DestroyMethod
>>> @org.xbean.FactoryMethod
>>>
>>
>> BTW no biggie but how about using 1 annotation with different  
>> properties on it? e.g.
>>
>> @org.xbean.XBean(initMethod="foo", destroyMethod="bar")....
>
> Well xdoc doesn't support that format, but I'd love for them to add  
> it.  If we were, to support this today it would look like this:
>
>   @org.xbean.XBean initMethod="foo" destroyMethod="bar"
>
> Anyway, this kind of comes down to preference.  I like to just tag  
> the init and destroy method directly, but it looks you prefer to do  
> the annotation on the class.  How about we support both?  We allow  
> the user to use one format or the other, but not both.

I'm just back from vacation so my brain's not yet up to speed :)

Annotating the method seems better to me so please ignore my previous  
comment. Adding an annotation on the method should be encouraged for  
refactoring purposes. Bad James! I'm off to drink a few pints of  
coffee...

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

LightInTheBox - Buy quality products at wholesale price!