Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » JavaDocs from JET
JavaDocs from JET [message #45498] Tue, 13 May 2008 16:22 Go to next message
Roshan S. is currently offline Roshan S.
Messages: 125
Registered: July 2009
Senior Member
Is there anything in works to generate JavaDocs from templates? I suppose
a tag can be created to process it's body content, but then it needs to be
put into the compiled java classes.

-Roshan
Re: JavaDocs from JET [message #45557 is a reply to message #45498] Fri, 16 May 2008 12:48 Go to previous messageGo to next message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
Roshan:

Short answer: No, nothing is in plan

But what are you looking for?

Paul
Re: JavaDocs from JET [message #45796 is a reply to message #45557] Fri, 16 May 2008 18:37 Go to previous messageGo to next message
Roshan S. is currently offline Roshan S.
Messages: 125
Registered: July 2009
Senior Member
Well i what i wanted was the comments in the templates to be converted to
java doc comments in the class that is generated from the templates.

I see two things it can be useful for:
-If there was a way to create javadoc comments for the entire class and
the generate method, then there'd be a way to generate the javadoc file
for the templates.

-Also, if the comments within the templates were put into translated java
files it'd be easier to debug when stepping through transform run.
Re: JavaDocs from JET [message #45945 is a reply to message #45796] Tue, 20 May 2008 15:36 Go to previous messageGo to next message
Roshan S. is currently offline Roshan S.
Messages: 125
Registered: July 2009
Senior Member
I'm thinking about changing the source for Jet to handle Comments
differently. What I want to do is to create JavaDocs from comments '<!--
....--!>' I only need the class level java doc comments. Anyone know
what packages and classes I need to look at to change this?
Re: JavaDocs from JET [message #46284 is a reply to message #45945] Thu, 22 May 2008 13:32 Go to previous messageGo to next message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
If you do this, I'd be interested in having this contributed...

JET generates its Java code via a JET template (is anyone surprised):

org.elcipse.jet/templates/v2/jet2java.jet

The template doesn't use any tag, only embedded Java
scriptlets/expressions.

I works against the AST for the JET template (package
org.eclipse.jet.core.parser.ast). The class you care about there is
Comment.

The template traverses the AST via an visitor. Right now, it ignores
Comment objects. It'd be easy enough to add something like to the visitor
insider the generate method:

<%
public boolean visitComment(Comment comment) {
%>
// <%= comment.getCommentText() %>
<%
return true;
}
%>

This is, of course, too simple. You'd have to handle newlines in the
comment text (the new IndentTag.indent() might be useful).

You also might want to think about whether some comments might include a
special flag that would cause them to placed at other locations in the
output. Some ideas...
<%-- @header
... copyright information
--%>
<%-- @class
... Class Java doc
--%>

Again, I'd be very interested in a contribution.
Re: JavaDocs from JET [message #46402 is a reply to message #46284] Thu, 22 May 2008 15:15 Go to previous messageGo to next message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
Roshan:

After having written all this, I decided the code was 90% done. Have have
just included the above changes in a fix for

https://bugs.eclipse.org/bugs/show_bug.cgi?id=205811

It will appear in Monday's build.

Paul
Re: JavaDocs from JET [message #46520 is a reply to message #46402] Wed, 28 May 2008 19:55 Go to previous messageGo to next message
Roshan S. is currently offline Roshan S.
Messages: 125
Registered: July 2009
Senior Member
Thanks for the update Paul. I'll try out the build. When will this be
available in a release? Will it be in 0.9.0?
Re: JavaDocs from JET [message #46575 is a reply to message #46520] Thu, 29 May 2008 16:44 Go to previous message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
Roshan:

It will be in 0.9.0.

Paul

"Roshan Soni" <roshan.soni1@gmail.com> wrote in message
news:7293df9d1b6bde91d1d23b82dd76460b$1@www.eclipse.org...
> Thanks for the update Paul. I'll try out the build. When will this be
> available in a release? Will it be in 0.9.0?
>
Previous Topic:[jet] error reporting
Next Topic:Acessing elements from a list
Goto Forum:
  


Current Time: Mon Sep 22 12:33:30 GMT 2014

Powered by FUDForum. Page generated in 0.13953 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software