Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » <java:class> in non source-folder
<java:class> in non source-folder [message #45706] Fri, 16 May 2008 15:41 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
Hey Paul,

some time ago I read about problems when the srcFolder attribute of a
<java:class> tag is not a "source folder". This is a problem for me, so I think
about switching to the <ws:file> tag. Before trying, I'd like to ask about
possible problems, e.g. in the template which is responsible for generating the
class content I use all other kinds of <java> tags. Do these in some way rely on
being "inside" a <java:file> tag?

What is the general advantage from using <java:class> over <ws:file>?

Thanks,
Felix
Re: <java:class> in non source-folder [message #45767 is a reply to message #45706] Fri, 16 May 2008 16:50 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
I don't seem to get it done. The problem is that I suddenly get no more
exception traces. Jet just says "errors during execution".

I tried it like that. Maybe someone finds what I do wrong, I am unsure about
those variables in xpath functions..

<c:iterate select="//Class" var="_class">

<ws:file path="{concat($genpath,replace($_class/@__qname, '.','/'),'.java')}"
template="templates/class.jet"/>
</c:iterate>

<c:iterate select="//Enumeration" var="_enum">
<ws:file path="{concat($genpath,replace($_enum/@__qname, '.','/'),'.java')}"
template="templates/enumeration.jet"/>
</c:iterate>

Thanks,
Felix
Re: <java:class> in non source-folder [message #46056 is a reply to message #45706] Thu, 22 May 2008 00:17 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Felix:

Sorry, somehow I missed the messages earlier...

The only real advantage of java:class over ws:file is that you don't have to
any mapping from java package names to directory names.

The java:class tag does use the JDT apis to find source folders and
packages, but ultimately, it turns all this info into an IFolder, and then
creates an IFile with a .java extension.

The one bit of magic that java:class does is if you specify a project name
as the source folder. If that project has explicitly specified source
folders, then java:class will use the first one.

I'm not aware of any problems with java:class.

Paul
Re: <java:class> in non source-folder [message #46085 is a reply to message #45767] Thu, 22 May 2008 00:20 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Felix:

I prefer:

<ws:file path="{$genpath}/{replace($_class/@__qname, '.','/')}.java"
template="templates/class.jet"/>

but, I don't see anything wrong with your example, unless $genpath doesn't
end with a /

Is there anything in the error log?

Paul
Previous Topic:Re: jet editor java syntax coloring
Next Topic:Re: package explorer doesn't show source folders
Goto Forum:
  


Current Time: Wed Nov 26 15:07:11 GMT 2014

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

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