Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse JET Guide
Previous Page Home Next Page

JET Java Declaration Syntax Reference

JET templates may declare Java methods or fields by enclosing it within the characters <%! and %>.

Valid Declarations

Each declaration may contain one or more syntactically correct Java method or field declarations. The following are examples of valid declarations:

<%!
/**
 * Say hello the the addressee passed to the method
 */
public String hello(String addressee) {
   return "Hello " + addresseee + "!";
}
%>

<%!
// 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);
}
%>

Invalid Declarations

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.

Escaping Declaration characters

To emit the characters <%! in a templates output, enter <\%!. To emit %>, enter %\>.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire