On Fri, 2005-07-29 at 15:35, Haroon Rafique wrote:
> On Today at 9:21am, PG=>Paul Galbraith <[EMAIL PROTECTED]> wrote:
> 
> PG> 
> PG> I believe it should be in the next release, and we should make a beta 
> PG> release of it soon.
> PG> 
> 
> Hi Paul,
> 
> I just wanted to clarify something. I hope you can provide the answer.
> 
> >From what I have seen, the work done under 
> http://opensource.atlassian.com/projects/xdoclet/browse/XJD-41 is along 
> the lines of developing a parser which will not die on JDK 1.5 code. IMHO, 
> that's only half the battle. Don't get me wrong, I am very thankful to 
> Anton, Heiko and the rest of the developers for taking this initiative. 
> (Disclaimer: I am already using the solution from XJD-41 to parse my JDK 
> 1.5 sources). Now, the other half of the battle is to make a lot of the 
> templates JDK 1.5 aware. 

No great urgency IMHO.  By the time we'd updated XDoclet to generate DDs
etc. from annotations, the app server vendors will probably have updated
their products to use annotations instead of DDs...
If you have a look through the J2EE 5 specs in public review
(http://java.sun.com/j2ee/5.0/index.jsp) you'll see they include one for
standard annotations, and the EJB 3 one states that it will include
"Definition of the Java metadata attributes that can be used to annotate
EJB applications. Such metadata will be also be targeted at reducing or
eliminating the need for the bean developer to provide an EJB deployment
descriptor. Use of metadata will further enable the generation of
component and home interfaces for an EJB component from the enterprise
bean class itself."
In short, the metadata will do everything XDoclet does at the moment,
and any configuration that can't be covered by those annotations would
likely be the things that currently have to be specified in a merge file
anyway.  The main advantage in having XDoclet be driven by annotations
would be to enable a single set of source files with annotations to be
used with both new app servers (that use the annotations directly) and
old ones (which would use the generated files as before).  But that's
not a particularly common requirement.  So, if you want to use
annotations then don't use XDoclet, use EJB 3.0 :-)

Of course, it may be that gaps in the J2EE 5.0 specs mean there'd still
be a use for an annotation-driven XDoclet, but it's not worth worrying
about that until the final versions of the specs are available.  At
least, that's how I see it.  Others' opinions may vary.

> To your knowledge, is there any work being done to make the templates JDK 
> 1.5 aware? Its a step in the right direction to make the 1.5-aware parser 
> part of the beta release.

"Aware" in what sense?  Generating things that use 1.5-specific features
is unlikely, as we need to retain backward compatibility.  Having them
driven by annotations instead of @tags would be possible but, for the
reasons I mentioned above, is likely to be wasted effort in the longer
term.  Not dying on 1.5-based sources was the main thing that needed
fixing.

> Is there anything I can do to help? I did look at the latest 
> xjavadoc sources (both from CVS and Anton's downloads) and will have to 
> admit that grokking all of xjavadoc is beyond me at this point. Is XMethod 
> the starting point?

Probably one of its superclasses, since class/field/constructor level
metadata is also exposed.  You may need to modify the javacc/jjtree
grammar files as well; just because it now recognises tokens for the new
syntax, doesn't mean it does anything with them.  I haven't been paying
too close attention to the xjavadoc updates, though, so I can't be any
more specific than that.
Once you've got XJavadoc to expose the annotations, probably the easiest
way to have the templates make use of them is to update the tag
handlers, so that e.g. <XDTClass:ifHasClassTag> looks for a class-level
annotation of the same name as well as the @tag.  Otherwise you'll end
up more or less duplicating everything that's in the templates to test
for the annotations too.
Alternatively, you could leave the API as it is, but have the various
classes return an XTag for each annotation too.  That way you don't have
to update the tag handlers either.  Of course, once the "standard"
metadata names get finalised, you'll probably want to update the
templates to look for class/method tags with those names too.  There's
already some support in there for alternative tag names (mainly used in
the jboss module, I think).

No doubt Konstantin will be along in a minute to suggest you consider
XDoclet 2 for any new development (at http://xdoclet.codehaus.org) ;-) 
I don't know how well (if at all) the QDox parser which that uses
handles 1.5 syntax, though.


Andrew.



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
xdoclet-user mailing list
xdoclet-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to