|
Re: A few questions about JET2... [message #518216 is a reply to message #518128] |
Wed, 03 March 2010 09:10 |
Paul Elder 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03744 seconds