Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.jet/templates/jet2java.javajet')
-rw-r--r--plugins/org.eclipse.jet/templates/jet2java.javajet94
1 files changed, 0 insertions, 94 deletions
diff --git a/plugins/org.eclipse.jet/templates/jet2java.javajet b/plugins/org.eclipse.jet/templates/jet2java.javajet
deleted file mode 100644
index 1c29187..0000000
--- a/plugins/org.eclipse.jet/templates/jet2java.javajet
+++ /dev/null
@@ -1,94 +0,0 @@
-<%@jet package="org.eclipse.jet.internal.compiler.templates"
- class="JET2JavaGenerator"
- imports="org.eclipse.jet.internal.compiler.* org.eclipse.jet.compiler.* org.eclipse.jet.internal.JavaUtil org.eclipse.jet.taglib.TagLibraryReference java.util.Iterator"
- %>
-<%
- JET2CompilationUnit cu = (JET2CompilationUnit)argument;
-
- final StringBuffer declarations = new StringBuffer();
- cu.accept(new DefaultJET2ASTVisitor() {
- public void visit(JET2Declaration declaration) {
- declarations.append(declaration.getJavaContent());
- }
- });
-
- final StringBuffer tagNamespaceVariables = new StringBuffer();
- TagLibraryReference[] tlRefs = cu.getTagLibraryReferences();
- for(int i = 0; i < tlRefs.length; i++ ) {
- ;
- tagNamespaceVariables.append("public static final String _jetns_")
- .append(tlRefs[i].getPrefix())
- .append(" = \"")
- .append(tlRefs[i].getTagLibraryId())
- .append("\";")
- .append("//$NON-NLS-1$")
- .append(NL);
-
- }
-
- final StringBuffer tagDataDeclarations = new StringBuffer();
- cu.accept(new DefaultJET2ASTVisitor() {
- private void writeDecl(XMLElement element) {
- tagDataDeclarations.append("final TagInfo ")
- .append(MethodBodyCreator.tagInfoVariableName(element))
- .append(" = new TagInfo( ")
- .append('"').append(element.getName()).append("\", ")
- .append(element.getLine()).append(", ")
- .append(element.getColumn()).append(", ")
- ;
- tagDataDeclarations.append(" new String[] {");
- for (Iterator i = element.getAttributes().keySet().iterator(); i.hasNext();) {
- String attrName = (String) i.next();
- tagDataDeclarations.append('"').append(attrName).append("\", ");
- }
- tagDataDeclarations.append("}, ");
- tagDataDeclarations.append(" new String[] {");
- for (Iterator i = element.getAttributes().values().iterator(); i.hasNext();) {
- String attrValue = (String) i.next();
- tagDataDeclarations.append(JavaUtil.asJavaQuotedString(attrValue.toCharArray())).append(", ");
- }
- tagDataDeclarations.append("});").append(NL);
- }
-
- public void visit(XMLBodyElement element) {
- writeDecl(element);
- }
-
- public void visit(XMLEmptyElement element) {
- writeDecl(element);
- }
- });
- MethodBodyCreator generatedBody = new MethodBodyCreator();
- cu.accept(generatedBody);
-%>
-package <%= cu.getOutputJavaPackage() %>;
-
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.JET2Template;
-import org.eclipse.jet.JET2Writer;
-import org.eclipse.jet.taglib.RuntimeTagElement;
-import org.eclipse.jet.taglib.TagInfo;
-<% for(Iterator i=cu.getImports().iterator();i.hasNext();) {
- String importName = (String)i.next();%>
-import <%=importName%>;
-<% } %>
-
-public class <%= cu.getOutputJavaClassName() %> implements JET2Template {
-
- <%= tagNamespaceVariables %>
-
- <%= declarations %>
-
- public <%= cu.getOutputJavaClassName() %>() {
- super();
- }
-
- public void generate(JET2Context context, JET2Writer out) {
-
- <%= tagDataDeclarations %>
-
- <%= generatedBody.getBuffer() %>
- }
-
-}
- \ No newline at end of file

Back to the top