Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'doc/org.eclipse.jet.doc/references/syntax')
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/implicitJavaObjectsReference.xhtml68
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxComments.xhtml50
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDeclarations.xhtml63
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDirectives.xhtml184
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml57
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxReference.xhtml54
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxScriptlets.xhtml61
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxXMLTags.xhtml108
8 files changed, 645 insertions, 0 deletions
diff --git a/doc/org.eclipse.jet.doc/references/syntax/implicitJavaObjectsReference.xhtml b/doc/org.eclipse.jet.doc/references/syntax/implicitJavaObjectsReference.xhtml
new file mode 100644
index 0000000..c9b8845
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/implicitJavaObjectsReference.xhtml
@@ -0,0 +1,68 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>Implicit JET Objects Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>Implicit JET Objects Reference</h2>
+
+ <p>JET implicitly creates a number of Java objects that accessible
+ to Java Expressions and Java Scriptlets. The table below summarizes
+ their names, Java types and purpose.</p>
+
+ <table border="1">
+
+ <tbody>
+
+ <tr>
+
+ <th>Object</th>
+
+ <th>Java type</th>
+
+ <th>Purpose</th>
+
+ </tr>
+
+ <tr>
+
+ <td><code>context</code></td>
+
+ <td>
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/javadoc/org/eclipse/jet/JET2Context.html"><code>org.eclipse.jet.JET2Context</code></a></td>
+
+ <td>Provide access to template invocation information.</td>
+
+ </tr>
+
+ <tr>
+
+ <td><code>out</code></td>
+
+ <td>
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/javadoc/org/eclipse/jet/JET2Writer.html"><code>org.eclipse.jet.JET2Writer</code></a></td>
+
+ <td>The writer to which the template output is being
+ written.</td>
+
+ </tr>
+
+ </tbody>
+
+ </table>
+
+ <ul />
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxComments.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxComments.xhtml
new file mode 100644
index 0000000..908905d
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxComments.xhtml
@@ -0,0 +1,50 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET Comment Reference Syntax</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET Comment Syntax Reference</h2>
+
+ <p>JET templates may contain comments between the characters
+ <code>&lt;%--</code> and <code>--%&gt;</code>. JET ignores all
+ content in a comment. </p>
+
+ <h3>Valid comments</h3>
+
+ <p>Comments may span several lines, and may contain any text. The
+ following are examples of a JET comments:</p>
+
+ <pre>&lt;%-- This comment will not appear in the template output --%&gt;
+&lt;%-- This directive is not used
+&lt;%@taglib id=&quot;org.eclipse.jet.controlTags&quot; prefix=&quot;cc&quot;%&gt;
+--%&gt;</pre>
+ <h3>Invalid comments</h3>
+
+ <p>Comments may not appear within other JET elements. The following
+ are illegal comments:</p>
+
+ <pre>&lt;%@taglib id=&quot;org.eclipse.jet.controlTags&quot; &lt;%-- illegal comment --%&gt;
+ prefix=&quot;cc&quot; %&gt;</pre>
+ <h3>Escaping comment characters</h3>
+
+ <p>To emit the characters <code>&lt;%--</code> in a templates
+ output, enter <code>&lt;\%--</code>. To emit <code>--%&gt;</code>,
+ enter <code>--%\&gt;</code>.</p>
+
+ <p>The following is an example of an escaped JET comments:</p>
+
+ <pre>&lt;\%-- this will show in the template output --%\&gt;</pre>
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDeclarations.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDeclarations.xhtml
new file mode 100644
index 0000000..7b252df
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDeclarations.xhtml
@@ -0,0 +1,63 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET Java Declaration Syntax Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET Java Declaration Syntax Reference</h2>
+
+ <p>JET templates may declare Java methods or fields by enclosing it
+ within the characters <code>&lt;%!</code> and <code>%&gt;</code>.
+ </p>
+
+ <h3>Valid Declarations</h3>
+
+ <p>Each declaration may contain one or more syntactically correct
+ Java method or field declarations. The following are examples of
+ valid declarations:</p>
+
+ <pre>&lt;%!
+/**
+ * Say hello the the addressee passed to the method
+ */
+public String hello(String addressee) {
+ return &quot;Hello &quot; + addresseee + &quot;!&quot;;
+}
+%&gt;
+
+&lt;%!
+// Declarations may contain multiple Java declarations
+private int min(int a, int b) {
+ return Math.min(a, b);
+}
+
+private int max(int a, int b) {
+ return Math.max(a, b);
+}
+%&gt;</pre>
+ <h3>Invalid Declarations</h3>
+
+ <p>If a declaration contains an syntax error, the generated Java
+ code for the containing template will have a syntax error. The JET
+ compile does not attempt to correlate the Java compile error back
+ to the JET template.</p>
+
+ <h3>Escaping Declaration characters</h3>
+
+ <p>To emit the characters <code>&lt;%!</code> in a templates
+ output, enter <code>&lt;\%!</code>. To emit <code>%&gt;</code>,
+ enter <code>%\&gt;</code>.</p>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDirectives.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDirectives.xhtml
new file mode 100644
index 0000000..8fc6ca1
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxDirectives.xhtml
@@ -0,0 +1,184 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET Derective Syntax Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET Syntax Reference</h2>
+
+ <p>JET has the following directives</p>
+
+ <ul>
+
+ <li><a href="#jet">@jet</a> - affects Java code created by the
+ JET compiler.</li>
+
+ <li><a href="#taglib">@taglib</a> - imports a tag library into
+ the template for use, and assigns it a unique namespace
+ prefix.</li>
+
+ </ul>
+
+ <p>JET recognizes the following &quot;Classic&quot; JET directives,
+ but does not yet implement them. An error message is issued if any
+ of the following directives are recognized:</p>
+
+ <ul>
+
+ <li>@include</li>
+
+ <li>@start</li>
+
+ <li>@end</li>
+
+ </ul>
+
+ <p>To emit the characters <code>&lt;%@</code> in a templates
+ output, enter <code>&lt;\%@</code>. To emit <code>%&gt;</code>,
+ enter <code>%\&gt;</code></p>
+
+ <h3><a name="jet"/>The @jet directive</h3>
+
+ <p>The @jet directive controls the name of the generated Java
+ class, its containing package and the Java classes it imports.</p>
+
+ <p>All attributes are optional.The following tag summarizes the
+ available attributes.</p>
+
+ <table border="1">
+
+ <tbody>
+
+ <tr>
+
+ <th>Attribute</th>
+
+ <th>Usage</th>
+
+ </tr>
+
+ </tbody>
+
+ <tbody>
+
+ <tr>
+
+ <td>package</td>
+
+ <td>Name of package into which the template will be compiled.
+ May be used only once per template.</td>
+
+ </tr>
+
+ <tr>
+
+ <td>class</td>
+
+ <td>Name of Java class to be generated. May be used only once
+ per template.</td>
+
+ </tr>
+
+ <tr>
+
+ <td>imports</td>
+
+ <td>A space separated list of Java import locations.</td>
+
+ </tr>
+
+ <tr>
+
+ <td>startTag</td>
+
+ <td>A two character replacement for &lt;% in subsequent JET
+ elements.</td>
+
+ </tr>
+
+ <tr>
+
+ <td>endTag</td>
+
+ <td>A two character replacement for %&gt; in subsequent JET
+ elements.</td>
+
+ </tr>
+
+ </tbody>
+
+ </table>
+
+ <h3><a name="taglib"/>The @taglib directive</h3>
+
+ <p>The @taglib directive imports an XML tag library, or renames the
+ taglibrary namespace prefix. Example:</p>
+
+ <pre>&lt;%@taglib id=&quot;org.eclipse.jet.controlTags&quot; prefix=&quot;cc&quot;%&gt;</pre>
+ <p>The value for prefix must be value XML NCName, namely, it must
+ start with letter or underscore (_), and then contain letters,
+ digits or the characters underscore (_), hyphen (-) or dot (.).</p>
+
+ <p>The id for the Standard JET tag libaries are:</p>
+
+ <table border="1">
+
+ <tbody>
+
+ <tr>
+
+ <th>Tag Library</th>
+
+ <th>ID</th>
+
+ </tr>
+
+ <tr>
+
+ <td>Control Tags</td>
+
+ <td>org.eclipse.jet.controlTags</td>
+
+ </tr>
+
+ <tr>
+
+ <td>Workspace Tags</td>
+
+ <td>org.eclipse.jet.workspaceTags</td>
+
+ </tr>
+
+ <tr>
+
+ <td>Java Tags</td>
+
+ <td>org.eclipse.jet.javaTags</td>
+
+ </tr>
+
+ <tr>
+
+ <td>Format Tags</td>
+
+ <td>org.eclipse.jet.formatTags</td>
+
+ </tr>
+
+ </tbody>
+
+ </table>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml
new file mode 100644
index 0000000..34b69cd
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml
@@ -0,0 +1,57 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET Expressions Syntax Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET Expressions Syntax Reference</h2>
+
+ <p>JET Templates may emit the result of a Java expression by
+ enclosing the Java expression between the characers
+ <code>&lt;%=</code> and <code>%&gt;</code>.</p>
+
+ <h3>Valid Expressions</h3>
+
+ <p>Expressions contain valid Java expressions. Java expressions are
+ not complete statements, and in particular, they do not include a
+ semi-colon (;). Expressions may access any Java element inscope
+ Java elemement, including fields and methods declared in
+ <a href="jetSyntaxDeclarations.xhtml">Java declarations</a>, or in
+ <a href="jetSyntaxScriptlets.xhtml">Java scriptlets</a>, or
+ <a href="implicitJavaObjectsReference.xhtml">Implicit Java
+ Objects</a>.</p>
+
+ <p>The emitted Java code for the template will evaluate the Java
+ expression and convert the result to a string (if necessary). The
+ following are examples of Java expressions:</p>
+
+ <pre>The name of the class executing is: &lt;%= this.getClass().getName() %&gt;
+
+Although slightly silly, expression may be constant, like &lt;%= 5 %&gt; and &lt;%= &quot;hello&quot; %&gt;.</pre>
+ <h3>Invalid Expressions</h3>
+
+ <p>Any syntax error in the Java expression will result errors in
+ the emitted Java code. The JET compiler does not attempt to
+ correlate the Java compile error back to the JET template. Some
+ examples:</p>
+
+ <pre>&lt;%= 3 + 4; %&gt; &lt;%-- semicolon not allowed in Java expressions --%&gt;</pre>
+ <h3>Escaping Expression characters</h3>
+
+ <p>To emit the characters <code>&lt;%=</code> in a templates
+ output, enter <code>&lt;\%=</code>. To emit <code>%&gt;</code>,
+ enter <code>%\&gt;</code></p>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxReference.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxReference.xhtml
new file mode 100644
index 0000000..eeda399
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxReference.xhtml
@@ -0,0 +1,54 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET Syntax Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET Syntax Reference</h2>
+
+ <p>JET Templates composed of text plus the following syntactic
+ elements:</p>
+
+ <ul>
+
+ <li><a href="jetSyntaxComments.xhtml">Comments</a> - &lt;%-- ...
+ --%&gt;</li>
+
+ <li><a href="jetSyntaxXMLTags.xhtml">Custom XML Tags</a></li>
+
+ <li><a href="jetSyntaxDirectives.xhtml">Directives</a> - &lt;%@
+ ... %&gt;</li>
+
+ <li><a href="jetSyntaxDeclarations.xhtml">Java declarations</a> -
+ &lt;%! ...%&gt;</li>
+
+ <li><a href="jetSyntaxExpressions.xhtml">Java Expressions</a> -
+ &lt;%= ... %&gt;</li>
+
+ <li><a href="jetSyntaxScriptlets.xhtml">Java Scriptlets</a> -
+ &lt;% ... %&gt;</li>
+
+ </ul>
+
+ <p>Other reference information:</p>
+
+ <ul>
+
+ <li><a href="implicitJavaObjectsReference.xhtml">Implicit Java
+ Objects</a> available to JET templates</li>
+
+ </ul>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxScriptlets.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxScriptlets.xhtml
new file mode 100644
index 0000000..d180d90
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxScriptlets.xhtml
@@ -0,0 +1,61 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET Java Scriptlet Syntax Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET Scriptlet Syntax Reference</h2>
+
+ <p>JET Templates may contain sections Java statements by enclosing
+ the Java expression between the characers <code>&lt;%</code> and
+ <code>%&gt;</code>.</p>
+
+ <h3>Valid scriptlets</h3>
+
+ <p>Scripts may contain one more more valid Java statements or
+ blocks. A scriptlet may also include a partial Java block, so long
+ as a subsequent scriptlet completes it. Scriplets may reference any
+ Java elements in scope, including variables declared in other
+ scriptlets, and methods and fields declared in
+ <a href="jetSyntaxDeclarations.xhtml">Java declarations</a> or
+ <a href="implicitJavaObjectsReference.xhtml">Implicit Java
+ Objects</a>. Some examples of valid scriplets:</p>
+
+ <pre>&lt;%
+int x = 3;
+%&gt;
+&lt;%
+int y = x * 6;
+%&gt;
+&lt;% if(y &gt;= 18) { %&gt;
+&lt;%-- The above scriptlet opens a block which is closed in the next scriptlet --%&gt;
+ Y is &gt;= 18
+&lt;% } %&gt;</pre>
+ <p>The emitted Java code for the template will contain the Java
+ statements in the generatation method.</p>
+
+ <h3>Invalid scriptlets</h3>
+
+ <p>Any syntax error in the Java statements will result in errors in
+ the emitted Java code. The JET compiler does not attempt to
+ correlate the Java compile error back to the JET template.</p>
+
+ <h3>Escaping Scriplet characters</h3>
+
+ <p>To emit the characters <code>&lt;%</code> in a templates output,
+ enter <code>&lt;\%</code>. To emit <code>%&gt;</code>, enter
+ <code>%\&gt;</code></p>
+
+ </body>
+
+</html>
+
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxXMLTags.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxXMLTags.xhtml
new file mode 100644
index 0000000..5f69af3
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxXMLTags.xhtml
@@ -0,0 +1,108 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET XML Tag Syntax Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET XML Tag Syntax Reference</h2>
+
+ <p>JET XML Tags are of two forms:</p>
+
+ <ul>
+
+ <li>Empty elements: &lt;<i>tagname</i>
+ [<i>attributes</i>]/&gt;</li>
+
+ <li>Content elements: &lt;<i>tagname</i>
+ [<i>attributes</i>]*&gt;<i>content</i>&lt;/<i>tagname</i>&gt;</li>
+
+ </ul>
+
+ <p>Attributes are of the form: <i>name</i>=&quot;<i>value</i>&quot;
+ or <i>name</i>=&apos;<i>value</i>&apos;. Attribute values may
+ contain any character other than the enclosing quote characters.</p>
+
+ <p>Typically, JET XML tag names include a namespace and a tag name
+ (<i>namespace</i>:<i>name</i>). JET will recognize an XML elements
+ if it recognizes the namespace. If it does not recognize the
+ namespace, or if the tag has no namespace, and the tagname is not
+ recognized, then JET will treat the tag as text.</p>
+
+ <h3>Standard JET Tags</h3>
+
+ <p>JET includes standard tag libraries for the following
+ purposes:</p>
+
+ <ul>
+
+ <li>
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/controlTags/overview.html"
+ >Control tags</a> - used for template control</li>
+
+ <li>
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/workspaceTags/overview.html"
+ >Workspace tags</a> - used to create workspace elements such as
+ projects, folders and files</li>
+
+ <li>
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/javaTags/overview.html"
+ >Java tags</a> - used for created Java workspace elements such as
+ Java classes and resources</li>
+
+ <li>
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/formatTags/overview.html"
+ >Format tags</a> - used for reformatting text.</li>
+
+ </ul>
+
+ <h3>Defining and changing Tag namespace prefixes</h3>
+
+ <p>The standard tags have default namespace prefixes of
+ <code>c</code>, <code>ws</code>, <code>java</code> and
+ <code>format</code> for the control, workspace, java and format
+ tags, respectively. By default, the control, java and format tags
+ are imported into every template.</p>
+
+ <p>Tag namespace prefixes may be changed for a single template by
+ using the <a href="jetSyntaxDirectives.xhtml#taglib">@taglib</a>
+ directive. For example, the following directive changes the
+ namespace prefix for the control tags to cc:</p>
+
+ <pre>&lt;%@taglib id=&quot;org.eclipse.jet.controlTags&quot; prefix=&quot;cc&quot;%&gt;</pre>
+ <p>Individual templates may change a tag libraries namespace to
+ avoid conflicts with static text being generated by the
+ template.</p>
+
+ <p>To change the default prefixes for a transform requires editing
+ the JET Transformations plugin.xml file. See the
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/extensionpoints/org_eclipse_jet_transform.html"
+ ><code>org.eclipse.jet.transform</code></a> extension point
+ documentation for details.</p>
+
+ <h3>Importing Tag namespaces</h3>
+
+ <p>Tag namespaces may be imported by the &lt;%@taglib%&gt;
+ directive on individual templates, or in plugin.xml for all
+ transformation templates.</p>
+
+ <h3>Declaring custom tags</h3>
+
+ <p>Users may define custom tags by creating an Eclipse plug-in
+ project, adding a dependency to the <code>org.eclipse.jet</code>
+ plug-in, and then implementing the
+ <a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/extensionpoints/org_eclipse_jet_tagLibraries.html"
+ ><code>org.elcipse.jet.tagLibrairies</code></a> extension point.</p>
+
+ </body>
+
+</html>
+

Back to the top