Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » A few questions about JET2...
A few questions about JET2... [message #518128] Wed, 03 March 2010 08:14 Go to next message
Alejandro Villamarin is currently offline Alejandro VillamarinFriend
Messages: 8
Registered: March 2010
Junior Member
Kind regards,

I've started using the last release of JET and yet it looks promising for my project, I have a few questions that I can't seem to find an answer:

1.- First, is there any documentation about the JET syntax or API? Can't seem to find it anywhere...

2.- Let's say I want to call a template (jet file) from another template (to create some sort of hierarchies) is there any other way that the file include instruction? That works fine but what happens if the template called receives parameters, how do I "pass" those?

3.- Lastly, is there any way to modify the logic of JET Builder? I mean, I tried the skeleton directive (which is now deprecated and dunno if I can use it any longer) but no matter what I do, all the logic is placed within the generate method. Let's suppose I just want the generate method to return true or false, and I will take care of the generation logic somewhere else in my implementation class.....is this feasible?

Best regards and many thanks!!
Alex
Re: A few questions about JET2... [message #518216 is a reply to message #518128] Wed, 03 March 2010 09:10 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Alejandro:

Alejandro Villamarin wrote:
> Kind regards,
>
> I've started using the last release of JET and yet it looks promising
> for my project, I have a few questions that I can't seem to find an answer:
>
> 1.- First, is there any documentation about the JET syntax or API? Can't
> seem to find it anywhere...

JET Syntax:
http://help.eclipse.org/galileo/topic/org.eclipse.jet.doc/re ferences/syntax/jetSyntaxReference.xhtml

JET APIs:
http://help.eclipse.org/galileo/topic/org.eclipse.jet.doc/re ferences/javadoc/overview-summary.html

>
> 2.- Let's say I want to call a template (jet file) from another template
> (to create some sort of hierarchies) is there any other way that the
> file include instruction? That works fine but what happens if the
> template called receives parameters, how do I "pass" those?

JET's parameter passing is crude. All variables are usually global, so a
normal c:include will see every variable currently in in existence.
But, c:include can simulate parameter passing via the passVariables
attribute. If used, a snapshot of the current variables is taken, then
the name variables are configured as the global variables, the template
is executed, and then an template termination, the saved variables are
restored.


>
> 3.- Lastly, is there any way to modify the logic of JET Builder? I mean,
> I tried the skeleton directive (which is now deprecated and dunno if I
> can use it any longer) but no matter what I do, all the logic is placed
> within the generate method. Let's suppose I just want the generate
> method to return true or false, and I will take care of the generation
> logic somewhere else in my implementation class.....is this feasible?

The 'skeleton' is not supported, and the builder always creates a
'generate' method. The most recent JET 1.1 (upcoming Helios release)
includes support for an 'extends' attribute on the <%@jet%> directive
that allows you to specify a Java base class. The base class needs a
default constructor. An example:

<%@jet extends="org.example.jet.AbstractTemplate"%>

The feature is described in this bug:
https://bugs.eclipse.org/295809

The build is available here:
http://www.eclipse.org/modeling/m2t/downloads/?showAll=1& ;hlbuild=I201002261103&project=jet#I201002261103

>
> Best regards and many thanks!!
> Alex

Glad to help,
Paul
Re: A few questions about JET2... [message #518594 is a reply to message #518216] Thu, 04 March 2010 15:10 Go to previous message
Alejandro Villamarin is currently offline Alejandro VillamarinFriend
Messages: 8
Registered: March 2010
Junior Member
Thanks, Paul, I'll give it a try and let you know how this works out.

Best regards,
Alex
Previous Topic:[xPand] how to create directory hierarchy
Next Topic:MWE: EvaluationException in CheckComponent: Type not found
Goto Forum:
  


Current Time: Sat Oct 05 13:32:53 GMT 2024

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

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

Back to the top