summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-06-01 12:01:21 (EDT)
committerpelder2006-06-01 12:01:21 (EDT)
commita50ffb84f3c8f13378e21d05d8b84798e3bf4f2c (patch)
tree09ab464b184b6bb87eb2ab46389ffec311fdaf4a
parent9e09e543bbcb52913574eea98ac556e998aa20bf (diff)
downloadorg.eclipse.jet-a50ffb84f3c8f13378e21d05d8b84798e3bf4f2c.zip
org.eclipse.jet-a50ffb84f3c8f13378e21d05d8b84798e3bf4f2c.tar.gz
org.eclipse.jet-a50ffb84f3c8f13378e21d05d8b84798e3bf4f2c.tar.bz2
[144779] Remove compiler warnings.
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/MethodBodyCreator.java1
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/CodeGenTemplateLoader.java16
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/DummyMain.java51
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2JavaGenerator.java100
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java53
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/TagDataDeclGenerator.java56
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/WriteJavaExpressionTemplate.java26
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/WriteTextElementTemplate.java31
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/XMLEndGenerator.java121
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/XMLStartGenerator.java223
-rw-r--r--plugins/org.eclipse.jet/templates/jet2java.jet12
-rw-r--r--plugins/org.eclipse.jet/templates/jet2transform.jet3
-rw-r--r--plugins/org.eclipse.jet/templates/tagDataDeclarations.jet2
-rw-r--r--plugins/org.eclipse.jet/templates/xmlStart.jet2
-rw-r--r--plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jarbin33338 -> 34006 bytes
-rw-r--r--plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jarbin33198 -> 36264 bytes
-rw-r--r--tests/org.eclipse.jet.tests/data/taglibs.jet.expected.java12
17 files changed, 328 insertions, 381 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/MethodBodyCreator.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/MethodBodyCreator.java
index 98c9f4d..3ea3c9c 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/MethodBodyCreator.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/MethodBodyCreator.java
@@ -31,7 +31,6 @@ import org.eclipse.jet.compiler.TextElement;
import org.eclipse.jet.compiler.XMLBodyElement;
import org.eclipse.jet.compiler.XMLElement;
import org.eclipse.jet.compiler.XMLEmptyElement;
-import org.eclipse.jet.internal.compiler.templates.CodeGenTemplateLoader;
import org.eclipse.jet.transform.TransformContextExtender;
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/CodeGenTemplateLoader.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/CodeGenTemplateLoader.java
index 0ae6015..7939b58 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/CodeGenTemplateLoader.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/CodeGenTemplateLoader.java
@@ -24,49 +24,49 @@ public class CodeGenTemplateLoader implements JET2TemplateLoader, JET2TemplateLo
public JET2Template getTemplate(String templatePath) {
if(pathToFactoryMap == null) {
pathToFactoryMap = new HashMap(8);
- pathToFactoryMap.put("templates/writeJavaExpression.jet",
+ pathToFactoryMap.put("templates/writeJavaExpression.jet", //$NON-NLS-1$
new TemplateFactoryMethod() {
public JET2Template newTemplate() {
return new org.eclipse.jet.internal.compiler.templates.WriteJavaExpressionTemplate();
}
});
- pathToFactoryMap.put("templates/jet2java.jet",
+ pathToFactoryMap.put("templates/jet2java.jet", //$NON-NLS-1$
new TemplateFactoryMethod() {
public JET2Template newTemplate() {
return new org.eclipse.jet.internal.compiler.templates.JET2JavaGenerator();
}
});
- pathToFactoryMap.put("templates/xmlStart.jet",
+ pathToFactoryMap.put("templates/xmlStart.jet", //$NON-NLS-1$
new TemplateFactoryMethod() {
public JET2Template newTemplate() {
return new org.eclipse.jet.internal.compiler.templates.XMLStartGenerator();
}
});
- pathToFactoryMap.put("templates/main.jet",
+ pathToFactoryMap.put("templates/main.jet", //$NON-NLS-1$
new TemplateFactoryMethod() {
public JET2Template newTemplate() {
return new org.eclipse.jet.internal.compiler.templates.DummyMain();
}
});
- pathToFactoryMap.put("templates/jet2transform.jet",
+ pathToFactoryMap.put("templates/jet2transform.jet", //$NON-NLS-1$
new TemplateFactoryMethod() {
public JET2Template newTemplate() {
return new org.eclipse.jet.internal.compiler.templates.JET2TransformGenerator();
}
});
- pathToFactoryMap.put("templates/xmlEnd.jet",
+ pathToFactoryMap.put("templates/xmlEnd.jet", //$NON-NLS-1$
new TemplateFactoryMethod() {
public JET2Template newTemplate() {
return new org.eclipse.jet.internal.compiler.templates.XMLEndGenerator();
}
});
- pathToFactoryMap.put("templates/tagDataDeclarations.jet",
+ pathToFactoryMap.put("templates/tagDataDeclarations.jet", //$NON-NLS-1$
new TemplateFactoryMethod() {
public JET2Template newTemplate() {
return new org.eclipse.jet.internal.compiler.templates.TagDataDeclGenerator();
}
});
- pathToFactoryMap.put("templates/writeTextElement.jet",
+ pathToFactoryMap.put("templates/writeTextElement.jet", //$NON-NLS-1$
new TemplateFactoryMethod() {
public JET2Template newTemplate() {
return new org.eclipse.jet.internal.compiler.templates.WriteTextElementTemplate();
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/DummyMain.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/DummyMain.java
index 45bfa1d..f1388ae 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/DummyMain.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/DummyMain.java
@@ -7,40 +7,35 @@ import org.eclipse.jet.taglib.RuntimeTagElement;
import org.eclipse.jet.taglib.TagInfo;
public class DummyMain implements JET2Template {
+ public static final String _jetns_f = "org.eclipse.jet.formatTags"; //$NON-NLS-1$
+ public static final String _jetns_c = "org.eclipse.jet.controlTags"; //$NON-NLS-1$
+ public static final String _jetns_java = "org.eclipse.jet.javaTags"; //$NON-NLS-1$
- public static final String _jetns_f = "org.eclipse.jet.formatTags";//$NON-NLS-1$
-public static final String _jetns_c = "org.eclipse.jet.controlTags";//$NON-NLS-1$
-public static final String _jetns_java = "org.eclipse.jet.javaTags";//$NON-NLS-1$
-
-
-
-
public DummyMain() {
super();
}
- public void generate(JET2Context context, JET2Writer out) {
-
- final TagInfo _jettd_c_log_2_1 = new TagInfo( "c:log", 2, 1, new String[] {}, new String[] {});
-
-
- out.write("");
- RuntimeTagElement _jettag_c_log_2_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "log", "c:log", _jettd_c_log_2_1);
- _jettag_c_log_2_1.setRuntimeParent(null);
- _jettag_c_log_2_1.setTagInfo(_jettd_c_log_2_1);
- _jettag_c_log_2_1.doStart(context, out);
- JET2Writer _jettag_c_log_2_1_saved_out = out;
- while (_jettag_c_log_2_1.okToProcessBody()) {
- out = out.newNestedContentWriter();
-
-out.write("This transform in not intended to be run.");
- _jettag_c_log_2_1.handleBodyContent(out);
- }
- out = _jettag_c_log_2_1_saved_out;
- _jettag_c_log_2_1.doEnd();
-out.write("\r\n");
+ public void generate(final JET2Context context, JET2Writer out) {
+ final TagInfo _jettd_c_log_2_1 = new TagInfo("c:log", //$NON-NLS-1$
+ 2, 1,
+ new String[] {
+ },
+ new String[] {
+ } );
+ RuntimeTagElement _jettag_c_log_2_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "log", "c:log", _jettd_c_log_2_1); //$NON-NLS-1$ //$NON-NLS-2$
+ _jettag_c_log_2_1.setRuntimeParent(null);
+ _jettag_c_log_2_1.setTagInfo(_jettd_c_log_2_1);
+ _jettag_c_log_2_1.doStart(context, out);
+ JET2Writer _jettag_c_log_2_1_saved_out = out;
+ while (_jettag_c_log_2_1.okToProcessBody()) {
+ out = out.newNestedContentWriter();
+ out.write( "This transform in not intended to be run." ); //$NON-NLS-1$
+ _jettag_c_log_2_1.handleBodyContent(out);
+ }
+ out = _jettag_c_log_2_1_saved_out;
+ _jettag_c_log_2_1.doEnd();
+ out.write( "\r\n" ); //$NON-NLS-1$
}
}
- \ No newline at end of file
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2JavaGenerator.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2JavaGenerator.java
index 55e0fa7..6d823cd 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2JavaGenerator.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2JavaGenerator.java
@@ -14,13 +14,11 @@ import java.util.List;
import java.util.Iterator;
public class JET2JavaGenerator implements JET2Template {
+ public static final String _jetns_f = "org.eclipse.jet.formatTags"; //$NON-NLS-1$
+ public static final String _jetns_c = "org.eclipse.jet.controlTags"; //$NON-NLS-1$
+ public static final String _jetns_java = "org.eclipse.jet.javaTags"; //$NON-NLS-1$
- public static final String _jetns_f = "org.eclipse.jet.formatTags";//$NON-NLS-1$
-public static final String _jetns_c = "org.eclipse.jet.controlTags";//$NON-NLS-1$
-public static final String _jetns_java = "org.eclipse.jet.javaTags";//$NON-NLS-1$
-
-
private XMLElement[] getAllXMLTags(JET2CompilationUnit cu) {
final List result = new ArrayList();
cu.accept(new DefaultJET2ASTVisitor() {
@@ -45,72 +43,62 @@ public static final String _jetns_java = "org.eclipse.jet.javaTags";//$NON-NLS-1
return (JET2Declaration[])result.toArray(new JET2Declaration[result.size()]);
}
-
+
public JET2JavaGenerator() {
super();
}
- public void generate(JET2Context context, JET2Writer out) {
-
- final TagInfo _jettd_c_include_76_4 = new TagInfo( "c:include", 76, 4, new String[] {"template", }, new String[] {"templates/tagDataDeclarations.jet", });
-
+ public void generate(final JET2Context context, JET2Writer out) {
+ final TagInfo _jettd_c_include_80_4 = new TagInfo("c:include", //$NON-NLS-1$
+ 80, 4,
+ new String[] {
+ "template", //$NON-NLS-1$
+ },
+ new String[] {
+ "templates/tagDataDeclarations.jet", //$NON-NLS-1$
+ } );
- out.write("");
-out.write("");
-out.write("");
-out.write("");
-out.write("");
-out.write("");
-out.write("");
-out.write("");
-out.write("");
-
- JET2CompilationUnit cu = (JET2CompilationUnit)context.getVariable("cu");
+ JET2CompilationUnit cu = (JET2CompilationUnit)context.getVariable("cu"); //$NON-NLS-1$
final JET2Declaration[] allMemberDeclarations = getAllJavaDeclarations(cu);
final XMLElement[] allXMLElements = getAllXMLTags(cu);
- final StringBuffer tagNamespaceVariables = new StringBuffer();
final TagLibraryReference[] tlRefs = cu.getTagLibraryReferences();
MethodBodyCreator generatedBody = new MethodBodyCreator(TransformContextExtender.getInstance(context).getLoader());
cu.accept(generatedBody);
-out.write("package ");
-out.write( cu.getOutputJavaPackage() );
-out.write(";\r\n\r\nimport org.eclipse.jet.JET2Context;\r\nimport org.eclipse.jet.JET2Template;\r\nimport org.eclipse.jet.JET2Writer;\r\nimport org.eclipse.jet.taglib.RuntimeTagElement;\r\nimport org.eclipse.jet.taglib.TagInfo;\r\n");
- for(Iterator i=cu.getImports().iterator();i.hasNext();) {
- String importName = (String)i.next();out.write("import ");
-out.write(importName);
-out.write(";\r\n");
- } out.write("\r\npublic class ");
-out.write( cu.getOutputJavaClassName() );
-out.write(" implements JET2Template {\r\n");
- for(int i = 0; i < tlRefs.length; i++ ) { out.write(" public static final String _jetns_");
-out.write( tlRefs[i].getPrefix() );
-out.write(" = \"");
-out.write( tlRefs[i].getTagLibraryId() );
-out.write("\"; //$NON-NLS-1$\r\n");
- } out.write("");
- for(int i = 0; i < allMemberDeclarations.length; i++) { out.write("\r\n");
-out.write( allMemberDeclarations[i].getJavaContent() );
-out.write("\r\n");
- } out.write("\r\n\tpublic ");
-out.write( cu.getOutputJavaClassName() );
-out.write("() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\tpublic void generate(final JET2Context context, JET2Writer out) {\r\n");
+ out.write( "package " ); //$NON-NLS-1$
+ out.write( cu.getOutputJavaPackage() );
+ out.write( ";\r\n\r\nimport org.eclipse.jet.JET2Context;\r\nimport org.eclipse.jet.JET2Template;\r\nimport org.eclipse.jet.JET2Writer;\r\n" ); //$NON-NLS-1$
+ if( allXMLElements.length > 0) { out.write( "import org.eclipse.jet.taglib.RuntimeTagElement;\r\nimport org.eclipse.jet.taglib.TagInfo;\r\n" ); //$NON-NLS-1$
+ } for(Iterator i=cu.getImports().iterator();i.hasNext();) {
+ String importName = (String)i.next(); out.write( "import " ); //$NON-NLS-1$
+ out.write(importName);
+ out.write( ";\r\n" ); //$NON-NLS-1$
+ } out.write( "\r\npublic class " ); //$NON-NLS-1$
+ out.write( cu.getOutputJavaClassName() );
+ out.write( " implements JET2Template {\r\n" ); //$NON-NLS-1$
+ if( allXMLElements.length > 0) { for(int i = 0; i < tlRefs.length; i++ ) { out.write( " public static final String _jetns_" ); //$NON-NLS-1$
+ out.write( tlRefs[i].getPrefix() );
+ out.write( " = \"" ); //$NON-NLS-1$
+ out.write( tlRefs[i].getTagLibraryId() );
+ out.write( "\"; //$NON-NLS-1$\r\n" ); //$NON-NLS-1$
+ } } for(int i = 0; i < allMemberDeclarations.length; i++) { out.write( "\r\n" ); //$NON-NLS-1$
+ out.write( allMemberDeclarations[i].getJavaContent() );
+ out.write( "\r\n" ); //$NON-NLS-1$
+ } out.write( "\r\n\tpublic " ); //$NON-NLS-1$
+ out.write( cu.getOutputJavaClassName() );
+ out.write( "() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\tpublic void generate(final JET2Context context, JET2Writer out) {\r\n" ); //$NON-NLS-1$
for(int i = 0; i < allXMLElements.length; i++) {
- context.setVariable("element", allXMLElements[i]); out.write("");
- RuntimeTagElement _jettag_c_include_76_4 = context.getTagFactory().createRuntimeTag(_jetns_c, "include", "c:include", _jettd_c_include_76_4);
- _jettag_c_include_76_4.setRuntimeParent(null);
- _jettag_c_include_76_4.setTagInfo(_jettd_c_include_76_4);
- _jettag_c_include_76_4.doStart(context, out);
-
- _jettag_c_include_76_4.doEnd();
-out.write("");
- } out.write("");
-out.write( generatedBody.getBuffer() );
-out.write("\r\n\t}\r\n\r\n}\r\n");
+ context.setVariable("element", allXMLElements[i]); //$NON-NLS-1$
+ RuntimeTagElement _jettag_c_include_80_4 = context.getTagFactory().createRuntimeTag(_jetns_c, "include", "c:include", _jettd_c_include_80_4); //$NON-NLS-1$ //$NON-NLS-2$
+ _jettag_c_include_80_4.setRuntimeParent(null);
+ _jettag_c_include_80_4.setTagInfo(_jettd_c_include_80_4);
+ _jettag_c_include_80_4.doStart(context, out);
+ _jettag_c_include_80_4.doEnd();
+ } out.write( generatedBody.getBuffer() );
+ out.write( "\r\n\t}\r\n\r\n}\r\n" ); //$NON-NLS-1$
}
}
- \ No newline at end of file
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java
index 74612df..e869afc 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java
@@ -3,57 +3,38 @@ package org.eclipse.jet.internal.compiler.templates;
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;
import java.util.Iterator;
import java.util.Map;
-import org.eclipse.jet.BodyContentWriter;
import org.eclipse.jet.internal.compiler.LoaderGenerationParameters;
public class JET2TransformGenerator implements JET2Template {
- public static final String _jetns_f = "org.eclipse.jet.formatTags";//$NON-NLS-1$
-public static final String _jetns_c = "org.eclipse.jet.controlTags";//$NON-NLS-1$
-public static final String _jetns_java = "org.eclipse.jet.javaTags";//$NON-NLS-1$
-
-
-
-
public JET2TransformGenerator() {
super();
}
- public void generate(JET2Context context, JET2Writer out) {
-
-
-
- out.write("");
-out.write("");
-out.write("");
-out.write("");
-out.write("");
+ public void generate(final JET2Context context, JET2Writer out) {
-LoaderGenerationParameters parms = (LoaderGenerationParameters)context.getVariable("args");
+LoaderGenerationParameters parms = (LoaderGenerationParameters)context.getVariable("args"); //$NON-NLS-1$
Map templateMap = (Map) parms.getTemplateMap();;
-out.write("package ");
-out.write( parms.getPackageName() );
-out.write(";\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\n\r\nimport org.eclipse.jet.JET2TemplateLoader;\r\nimport org.eclipse.jet.JET2TemplateLoaderExtension;\r\nimport org.eclipse.jet.JET2Template;\r\n\r\npublic class ");
-out.write( parms.getClassName() );
-out.write(" implements JET2TemplateLoader, JET2TemplateLoaderExtension {\r\n\r\n\tprivate interface TemplateFactoryMethod {\r\n\t\tpublic abstract JET2Template newTemplate();\r\n\t}\r\n\r\n\tprivate Map pathToFactoryMap = null;\r\n\t\r\n\tprivate JET2TemplateLoader delegate = null;\r\n\r\n\tpublic ");
-out.write( parms.getClassName() );
-out.write("() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\tpublic JET2Template getTemplate(String templatePath) {\r\n\t if(pathToFactoryMap == null) {\r\n\t pathToFactoryMap = new HashMap(");
-out.write( templateMap.size() );
-out.write(");\r\n");
+ out.write( "package " ); //$NON-NLS-1$
+ out.write( parms.getPackageName() );
+ out.write( ";\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\n\r\nimport org.eclipse.jet.JET2TemplateLoader;\r\nimport org.eclipse.jet.JET2TemplateLoaderExtension;\r\nimport org.eclipse.jet.JET2Template;\r\n\r\npublic class " ); //$NON-NLS-1$
+ out.write( parms.getClassName() );
+ out.write( " implements JET2TemplateLoader, JET2TemplateLoaderExtension {\r\n\r\n\tprivate interface TemplateFactoryMethod {\r\n\t\tpublic abstract JET2Template newTemplate();\r\n\t}\r\n\r\n\tprivate Map pathToFactoryMap = null;\r\n\t\r\n\tprivate JET2TemplateLoader delegate = null;\r\n\r\n\tpublic " ); //$NON-NLS-1$
+ out.write( parms.getClassName() );
+ out.write( "() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\tpublic JET2Template getTemplate(String templatePath) {\r\n\t if(pathToFactoryMap == null) {\r\n\t pathToFactoryMap = new HashMap(" ); //$NON-NLS-1$
+ out.write( templateMap.size() );
+ out.write( ");\r\n" ); //$NON-NLS-1$
for(Iterator i = templateMap.entrySet().iterator(); i.hasNext();){
Map.Entry entry = (Map.Entry)i.next();
-out.write("\t\t pathToFactoryMap.put(\"");
-out.write( entry.getKey() );
-out.write("\", //$NON-NLS-1$\r\n\t\t new TemplateFactoryMethod() {\r\n\t\t public JET2Template newTemplate() {\r\n return new ");
-out.write( entry.getValue() );
-out.write("();\r\n\t\t }\r\n\t\t });\r\n");
- } out.write(" }\r\n TemplateFactoryMethod factory = (TemplateFactoryMethod)pathToFactoryMap.get(templatePath);\r\n\t\treturn factory == null ? delegate == null ? null : delegate.getTemplate(templatePath) : factory.newTemplate();\r\n\t}\r\n\r\n public void setDelegateLoader(JET2TemplateLoader loader) {\r\n this.delegate = loader;\r\n }\r\n \r\n public JET2TemplateLoader getDelegateLoader() {\r\n return delegate;\r\n }\r\n}\r\n\r\n");
+ out.write( "\t\t pathToFactoryMap.put(\"" ); //$NON-NLS-1$
+ out.write( entry.getKey() );
+ out.write( "\", //$NON-NLS-1$\r\n\t\t new TemplateFactoryMethod() {\r\n\t\t public JET2Template newTemplate() {\r\n return new " ); //$NON-NLS-1$
+ out.write( entry.getValue() );
+ out.write( "();\r\n\t\t }\r\n\t\t });\r\n" ); //$NON-NLS-1$
+ } out.write( " }\r\n TemplateFactoryMethod factory = (TemplateFactoryMethod)pathToFactoryMap.get(templatePath);\r\n\t\treturn factory == null ? delegate == null ? null : delegate.getTemplate(templatePath) : factory.newTemplate();\r\n\t}\r\n\r\n public void setDelegateLoader(JET2TemplateLoader loader) {\r\n this.delegate = loader;\r\n }\r\n \r\n public JET2TemplateLoader getDelegateLoader() {\r\n return delegate;\r\n }\r\n}\r\n\r\n" ); //$NON-NLS-1$
}
}
- \ No newline at end of file
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/TagDataDeclGenerator.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/TagDataDeclGenerator.java
index ea7b0cb..b0f41d9 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/TagDataDeclGenerator.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/TagDataDeclGenerator.java
@@ -3,8 +3,6 @@ package org.eclipse.jet.internal.compiler.templates;
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;
import java.util.Iterator;
import org.eclipse.jet.taglib.JET2TagException;
import org.eclipse.jet.compiler.XMLElement;
@@ -12,57 +10,41 @@ import org.eclipse.jet.internal.compiler.MethodBodyCreator;
public class TagDataDeclGenerator implements JET2Template {
- public static final String _jetns_f = "org.eclipse.jet.formatTags";//$NON-NLS-1$
-public static final String _jetns_c = "org.eclipse.jet.controlTags";//$NON-NLS-1$
-public static final String _jetns_java = "org.eclipse.jet.javaTags";//$NON-NLS-1$
-
-
-
-
public TagDataDeclGenerator() {
super();
}
- public void generate(JET2Context context, JET2Writer out) {
-
-
-
- out.write("");
-out.write("");
-out.write("");
-out.write("");
-out.write("");
+ public void generate(final JET2Context context, JET2Writer out) {
XMLElement element;
try {
- element = (XMLElement)context.getVariable("element");
+ element = (XMLElement)context.getVariable("element"); //$NON-NLS-1$
} catch( JET2TagException e) {
out.write(e.toString());
return;
}
String varName = MethodBodyCreator.tagInfoVariableName(element);
-out.write(" final TagInfo ");
-out.write( varName );
-out.write(" = new TagInfo(\"");
-out.write(element.getName());
-out.write("\", //$NON-NLS-1$\r\n ");
-out.write( element.getLine() );
-out.write(", ");
-out.write( element.getColumn() );
-out.write(",\r\n new String[] {\r\n");
+ out.write( " final TagInfo " ); //$NON-NLS-1$
+ out.write( varName );
+ out.write( " = new TagInfo(\"" ); //$NON-NLS-1$
+ out.write(element.getName());
+ out.write( "\", //$NON-NLS-1$\r\n " ); //$NON-NLS-1$
+ out.write( element.getLine() );
+ out.write( ", " ); //$NON-NLS-1$
+ out.write( element.getColumn() );
+ out.write( ",\r\n new String[] {\r\n" ); //$NON-NLS-1$
for (Iterator i = element.getAttributes().keySet().iterator(); i.hasNext();) {
- String attrName = (String) i.next(); out.write(" \"");
-out.write( attrName );
-out.write("\", //$NON-NLS-1$\r\n");
- } out.write(" },\r\n new String[] {\r\n");
+ String attrName = (String) i.next(); out.write( " \"" ); //$NON-NLS-1$
+ out.write( attrName );
+ out.write( "\", //$NON-NLS-1$\r\n" ); //$NON-NLS-1$
+ } out.write( " },\r\n new String[] {\r\n" ); //$NON-NLS-1$
for (Iterator i = element.getAttributes().values().iterator(); i.hasNext();) {
- String attrValue = (String) i.next(); out.write(" \"");
-out.write( attrValue );
-out.write("\", //$NON-NLS-1$\r\n");
- } out.write(" } );\r\n");
+ String attrValue = (String) i.next(); out.write( " \"" ); //$NON-NLS-1$
+ out.write( attrValue );
+ out.write( "\", //$NON-NLS-1$\r\n" ); //$NON-NLS-1$
+ } out.write( " } );\r\n" ); //$NON-NLS-1$
}
}
- \ No newline at end of file
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/WriteJavaExpressionTemplate.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/WriteJavaExpressionTemplate.java
index d136ff5..0cd88fe 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/WriteJavaExpressionTemplate.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/WriteJavaExpressionTemplate.java
@@ -3,39 +3,23 @@ package org.eclipse.jet.internal.compiler.templates;
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;
import org.eclipse.jet.compiler.JET2Expression;
public class WriteJavaExpressionTemplate implements JET2Template {
- public static final String _jetns_f = "org.eclipse.jet.formatTags";//$NON-NLS-1$
-public static final String _jetns_c = "org.eclipse.jet.controlTags";//$NON-NLS-1$
-public static final String _jetns_java = "org.eclipse.jet.javaTags";//$NON-NLS-1$
-
-
-
-
public WriteJavaExpressionTemplate() {
super();
}
- public void generate(JET2Context context, JET2Writer out) {
-
-
-
- out.write("");
-out.write("");
+ public void generate(final JET2Context context, JET2Writer out) {
final String indent = (String)context.getVariable("indent"); //$NON-NLS-1$
final JET2Expression expr = (JET2Expression)context.getVariable("element"); //$NON-NLS-1$
-out.write("");
-out.write( indent );
-out.write("out.write(");
-out.write( expr.getJavaContent() );
-out.write(");\r\n");
+ out.write( indent );
+ out.write( "out.write(" ); //$NON-NLS-1$
+ out.write( expr.getJavaContent() );
+ out.write( ");\r\n" ); //$NON-NLS-1$
}
}
- \ No newline at end of file
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/WriteTextElementTemplate.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/WriteTextElementTemplate.java
index 91830ac..83d2228 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/WriteTextElementTemplate.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/WriteTextElementTemplate.java
@@ -3,43 +3,24 @@ package org.eclipse.jet.internal.compiler.templates;
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;
import org.eclipse.jet.compiler.TextElement;
import org.eclipse.jet.internal.JavaUtil;
public class WriteTextElementTemplate implements JET2Template {
- public static final String _jetns_f = "org.eclipse.jet.formatTags";//$NON-NLS-1$
-public static final String _jetns_c = "org.eclipse.jet.controlTags";//$NON-NLS-1$
-public static final String _jetns_java = "org.eclipse.jet.javaTags";//$NON-NLS-1$
-
-
-
-
public WriteTextElementTemplate() {
super();
}
- public void generate(JET2Context context, JET2Writer out) {
-
-
-
- out.write("");
-out.write("");
-out.write("");
+ public void generate(final JET2Context context, JET2Writer out) {
final String indent = (String)context.getVariable("indent"); //$NON-NLS-1$
final TextElement text = (TextElement)context.getVariable("element"); //$NON-NLS-1$
-out.write("");
- if(text.getText().length > 0) { out.write("");
-out.write( indent );
-out.write("out.write( ");
-out.write( JavaUtil.asJavaQuotedString(text.getText()) );
-out.write(" ); //$NON-NLS-1$\r\n");
- } out.write("");
-
+ if(text.getText().length > 0) { out.write( indent );
+ out.write( "out.write( " ); //$NON-NLS-1$
+ out.write( JavaUtil.asJavaQuotedString(text.getText()) );
+ out.write( " ); //$NON-NLS-1$\r\n" ); //$NON-NLS-1$
+ }
}
}
- \ No newline at end of file
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/XMLEndGenerator.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/XMLEndGenerator.java
index df831fa..00d8f61 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/XMLEndGenerator.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/XMLEndGenerator.java
@@ -8,70 +8,79 @@ import org.eclipse.jet.taglib.TagInfo;
import org.eclipse.jet.internal.compiler.GenXMLElement;
public class XMLEndGenerator implements JET2Template {
+ public static final String _jetns_f = "org.eclipse.jet.formatTags"; //$NON-NLS-1$
+ public static final String _jetns_c = "org.eclipse.jet.controlTags"; //$NON-NLS-1$
+ public static final String _jetns_java = "org.eclipse.jet.javaTags"; //$NON-NLS-1$
- public static final String _jetns_f = "org.eclipse.jet.formatTags";//$NON-NLS-1$
-public static final String _jetns_c = "org.eclipse.jet.controlTags";//$NON-NLS-1$
-public static final String _jetns_java = "org.eclipse.jet.javaTags";//$NON-NLS-1$
-
-
-
-
public XMLEndGenerator() {
super();
}
- public void generate(JET2Context context, JET2Writer out) {
-
- final TagInfo _jettd_c_get_7_1 = new TagInfo( "c:get", 7, 1, new String[] {"select", }, new String[] {"$indent", });
-final TagInfo _jettd_c_get_8_1 = new TagInfo( "c:get", 8, 1, new String[] {"select", }, new String[] {"$indent", });
-final TagInfo _jettd_c_get_10_1 = new TagInfo( "c:get", 10, 1, new String[] {"select", }, new String[] {"$indent", });
-final TagInfo _jettd_c_get_13_1 = new TagInfo( "c:get", 13, 1, new String[] {"select", }, new String[] {"$indent", });
-
-
- out.write("");
-out.write("");
+ public void generate(final JET2Context context, JET2Writer out) {
+ final TagInfo _jettd_c_get_7_1 = new TagInfo("c:get", //$NON-NLS-1$
+ 7, 1,
+ new String[] {
+ "select", //$NON-NLS-1$
+ },
+ new String[] {
+ "$indent", //$NON-NLS-1$
+ } );
+ final TagInfo _jettd_c_get_8_1 = new TagInfo("c:get", //$NON-NLS-1$
+ 8, 1,
+ new String[] {
+ "select", //$NON-NLS-1$
+ },
+ new String[] {
+ "$indent", //$NON-NLS-1$
+ } );
+ final TagInfo _jettd_c_get_10_1 = new TagInfo("c:get", //$NON-NLS-1$
+ 10, 1,
+ new String[] {
+ "select", //$NON-NLS-1$
+ },
+ new String[] {
+ "$indent", //$NON-NLS-1$
+ } );
+ final TagInfo _jettd_c_get_13_1 = new TagInfo("c:get", //$NON-NLS-1$
+ 13, 1,
+ new String[] {
+ "select", //$NON-NLS-1$
+ },
+ new String[] {
+ "$indent", //$NON-NLS-1$
+ } );
GenXMLElement element = (GenXMLElement) context.getVariable("element"); //$NON-NLS-1$
-out.write("");
- if(element.hasBody()) { out.write("");
- RuntimeTagElement _jettag_c_get_7_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_7_1);
- _jettag_c_get_7_1.setRuntimeParent(null);
- _jettag_c_get_7_1.setTagInfo(_jettd_c_get_7_1);
- _jettag_c_get_7_1.doStart(context, out);
-
- _jettag_c_get_7_1.doEnd();
-out.write(" ");
-out.write( element.getTagVariable() );
-out.write(".handleBodyContent(out);\r\n");
- RuntimeTagElement _jettag_c_get_8_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_8_1);
- _jettag_c_get_8_1.setRuntimeParent(null);
- _jettag_c_get_8_1.setTagInfo(_jettd_c_get_8_1);
- _jettag_c_get_8_1.doStart(context, out);
-
- _jettag_c_get_8_1.doEnd();
-out.write("}\r\n");
- if(element.requiresNewWriter()) { out.write("");
- RuntimeTagElement _jettag_c_get_10_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_10_1);
- _jettag_c_get_10_1.setRuntimeParent(null);
- _jettag_c_get_10_1.setTagInfo(_jettd_c_get_10_1);
- _jettag_c_get_10_1.doStart(context, out);
-
- _jettag_c_get_10_1.doEnd();
-out.write("out = ");
-out.write( element.getTagVariable() );
-out.write("_saved_out;\r\n");
- } out.write("");
- } out.write("");
- RuntimeTagElement _jettag_c_get_13_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_13_1);
- _jettag_c_get_13_1.setRuntimeParent(null);
- _jettag_c_get_13_1.setTagInfo(_jettd_c_get_13_1);
- _jettag_c_get_13_1.doStart(context, out);
-
- _jettag_c_get_13_1.doEnd();
-out.write( element.getTagVariable() );
-out.write(".doEnd();\r\n");
+ if(element.hasBody()) { RuntimeTagElement _jettag_c_get_7_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_7_1); //$NON-NLS-1$ //$NON-NLS-2$
+ _jettag_c_get_7_1.setRuntimeParent(null);
+ _jettag_c_get_7_1.setTagInfo(_jettd_c_get_7_1);
+ _jettag_c_get_7_1.doStart(context, out);
+ _jettag_c_get_7_1.doEnd();
+ out.write( " " ); //$NON-NLS-1$
+ out.write( element.getTagVariable() );
+ out.write( ".handleBodyContent(out);\r\n" ); //$NON-NLS-1$
+ RuntimeTagElement _jettag_c_get_8_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_8_1); //$NON-NLS-1$ //$NON-NLS-2$
+ _jettag_c_get_8_1.setRuntimeParent(null);
+ _jettag_c_get_8_1.setTagInfo(_jettd_c_get_8_1);
+ _jettag_c_get_8_1.doStart(context, out);
+ _jettag_c_get_8_1.doEnd();
+ out.write( "}\r\n" ); //$NON-NLS-1$
+ if(element.requiresNewWriter()) { RuntimeTagElement _jettag_c_get_10_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_10_1); //$NON-NLS-1$ //$NON-NLS-2$
+ _jettag_c_get_10_1.setRuntimeParent(null);
+ _jettag_c_get_10_1.setTagInfo(_jettd_c_get_10_1);
+ _jettag_c_get_10_1.doStart(context, out);
+ _jettag_c_get_10_1.doEnd();
+ out.write( "out = " ); //$NON-NLS-1$
+ out.write( element.getTagVariable() );
+ out.write( "_saved_out;\r\n" ); //$NON-NLS-1$
+ } } RuntimeTagElement _jettag_c_get_13_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_13_1); //$NON-NLS-1$ //$NON-NLS-2$
+ _jettag_c_get_13_1.setRuntimeParent(null);
+ _jettag_c_get_13_1.setTagInfo(_jettd_c_get_13_1);
+ _jettag_c_get_13_1.doStart(context, out);
+ _jettag_c_get_13_1.doEnd();
+ out.write( element.getTagVariable() );
+ out.write( ".doEnd();\r\n" ); //$NON-NLS-1$
}
}
- \ No newline at end of file
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/XMLStartGenerator.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/XMLStartGenerator.java
index a79dfe0..07fe686 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/XMLStartGenerator.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/XMLStartGenerator.java
@@ -8,112 +8,137 @@ import org.eclipse.jet.taglib.TagInfo;
import org.eclipse.jet.internal.compiler.GenXMLElement;
public class XMLStartGenerator implements JET2Template {
+ public static final String _jetns_f = "org.eclipse.jet.formatTags"; //$NON-NLS-1$
+ public static final String _jetns_c = "org.eclipse.jet.controlTags"; //$NON-NLS-1$
+ public static final String _jetns_java = "org.eclipse.jet.javaTags"; //$NON-NLS-1$
- public static final String _jetns_f = "org.eclipse.jet.formatTags";//$NON-NLS-1$
-public static final String _jetns_c = "org.eclipse.jet.controlTags";//$NON-NLS-1$
-public static final String _jetns_java = "org.eclipse.jet.javaTags";//$NON-NLS-1$
-
-
-
-
public XMLStartGenerator() {
super();
}
- public void generate(JET2Context context, JET2Writer out) {
-
- final TagInfo _jettd_c_get_6_1 = new TagInfo( "c:get", 6, 1, new String[] {"select", }, new String[] {"$indent", });
-final TagInfo _jettd_c_get_7_1 = new TagInfo( "c:get", 7, 1, new String[] {"select", }, new String[] {"$indent", });
-final TagInfo _jettd_c_get_8_1 = new TagInfo( "c:get", 8, 1, new String[] {"select", }, new String[] {"$indent", });
-final TagInfo _jettd_c_get_9_1 = new TagInfo( "c:get", 9, 1, new String[] {"select", }, new String[] {"$indent", });
-final TagInfo _jettd_c_get_12_1 = new TagInfo( "c:get", 12, 1, new String[] {"select", }, new String[] {"$indent", });
-final TagInfo _jettd_c_get_14_1 = new TagInfo( "c:get", 14, 1, new String[] {"select", }, new String[] {"$indent", });
-final TagInfo _jettd_c_get_16_1 = new TagInfo( "c:get", 16, 1, new String[] {"select", }, new String[] {"$indent", });
-
-
- out.write("");
-out.write("");
+ public void generate(final JET2Context context, JET2Writer out) {
+ final TagInfo _jettd_c_get_6_1 = new TagInfo("c:get", //$NON-NLS-1$
+ 6, 1,
+ new String[] {
+ "select", //$NON-NLS-1$
+ },
+ new String[] {
+ "$indent", //$NON-NLS-1$
+ } );
+ final TagInfo _jettd_c_get_7_1 = new TagInfo("c:get", //$NON-NLS-1$
+ 7, 1,
+ new String[] {
+ "select", //$NON-NLS-1$
+ },
+ new String[] {
+ "$indent", //$NON-NLS-1$
+ } );
+ final TagInfo _jettd_c_get_8_1 = new TagInfo("c:get", //$NON-NLS-1$
+ 8, 1,
+ new String[] {
+ "select", //$NON-NLS-1$
+ },
+ new String[] {
+ "$indent", //$NON-NLS-1$
+ } );
+ final TagInfo _jettd_c_get_9_1 = new TagInfo("c:get", //$NON-NLS-1$
+ 9, 1,
+ new String[] {
+ "select", //$NON-NLS-1$
+ },
+ new String[] {
+ "$indent", //$NON-NLS-1$
+ } );
+ final TagInfo _jettd_c_get_12_1 = new TagInfo("c:get", //$NON-NLS-1$
+ 12, 1,
+ new String[] {
+ "select", //$NON-NLS-1$
+ },
+ new String[] {
+ "$indent", //$NON-NLS-1$
+ } );
+ final TagInfo _jettd_c_get_14_1 = new TagInfo("c:get", //$NON-NLS-1$
+ 14, 1,
+ new String[] {
+ "select", //$NON-NLS-1$
+ },
+ new String[] {
+ "$indent", //$NON-NLS-1$
+ } );
+ final TagInfo _jettd_c_get_16_1 = new TagInfo("c:get", //$NON-NLS-1$
+ 16, 1,
+ new String[] {
+ "select", //$NON-NLS-1$
+ },
+ new String[] {
+ "$indent", //$NON-NLS-1$
+ } );
GenXMLElement element = (GenXMLElement) context.getVariable("element"); //$NON-NLS-1$
-out.write("");
- RuntimeTagElement _jettag_c_get_6_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_6_1);
- _jettag_c_get_6_1.setRuntimeParent(null);
- _jettag_c_get_6_1.setTagInfo(_jettd_c_get_6_1);
- _jettag_c_get_6_1.doStart(context, out);
-
- _jettag_c_get_6_1.doEnd();
-out.write("RuntimeTagElement ");
-out.write( element.getTagVariable() );
-out.write(" = context.getTagFactory().createRuntimeTag(_jetns_");
-out.write( element.getNSPrefix() );
-out.write(", \"");
-out.write( element.getTagNCName() );
-out.write("\", \"");
-out.write( element.getName() );
-out.write("\", ");
-out.write( element.getTagInfoVariable() );
-out.write(");\r\n");
- RuntimeTagElement _jettag_c_get_7_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_7_1);
- _jettag_c_get_7_1.setRuntimeParent(null);
- _jettag_c_get_7_1.setTagInfo(_jettd_c_get_7_1);
- _jettag_c_get_7_1.doStart(context, out);
-
- _jettag_c_get_7_1.doEnd();
-out.write( element.getTagVariable() );
-out.write(".setRuntimeParent(");
-out.write( element.getParentTagVariable() );
-out.write(");\r\n");
- RuntimeTagElement _jettag_c_get_8_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_8_1);
- _jettag_c_get_8_1.setRuntimeParent(null);
- _jettag_c_get_8_1.setTagInfo(_jettd_c_get_8_1);
- _jettag_c_get_8_1.doStart(context, out);
-
- _jettag_c_get_8_1.doEnd();
-out.write( element.getTagVariable() );
-out.write(".setTagInfo(");
-out.write( element.getTagInfoVariable() );
-out.write(");\r\n");
- RuntimeTagElement _jettag_c_get_9_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_9_1);
- _jettag_c_get_9_1.setRuntimeParent(null);
- _jettag_c_get_9_1.setTagInfo(_jettd_c_get_9_1);
- _jettag_c_get_9_1.doStart(context, out);
-
- _jettag_c_get_9_1.doEnd();
-out.write( element.getTagVariable() );
-out.write(".doStart(context, out);\r\n");
- if(element.hasBody()) { out.write("");
- if(element.requiresNewWriter()) { out.write("");
- RuntimeTagElement _jettag_c_get_12_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_12_1);
- _jettag_c_get_12_1.setRuntimeParent(null);
- _jettag_c_get_12_1.setTagInfo(_jettd_c_get_12_1);
- _jettag_c_get_12_1.doStart(context, out);
-
- _jettag_c_get_12_1.doEnd();
-out.write("JET2Writer ");
-out.write( element.getTagVariable() );
-out.write("_saved_out = out;\r\n");
- } out.write("");
- RuntimeTagElement _jettag_c_get_14_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_14_1);
- _jettag_c_get_14_1.setRuntimeParent(null);
- _jettag_c_get_14_1.setTagInfo(_jettd_c_get_14_1);
- _jettag_c_get_14_1.doStart(context, out);
-
- _jettag_c_get_14_1.doEnd();
-out.write("while (");
-out.write( element.getTagVariable() );
-out.write(".okToProcessBody()) {\r\n");
- if(element.requiresNewWriter()) { out.write("");
- RuntimeTagElement _jettag_c_get_16_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_16_1);
- _jettag_c_get_16_1.setRuntimeParent(null);
- _jettag_c_get_16_1.setTagInfo(_jettd_c_get_16_1);
- _jettag_c_get_16_1.doStart(context, out);
-
- _jettag_c_get_16_1.doEnd();
-out.write(" out = out.newNestedContentWriter();\r\n");
- } out.write("");
- } out.write("");
-
+ RuntimeTagElement _jettag_c_get_6_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_6_1); //$NON-NLS-1$ //$NON-NLS-2$
+ _jettag_c_get_6_1.setRuntimeParent(null);
+ _jettag_c_get_6_1.setTagInfo(_jettd_c_get_6_1);
+ _jettag_c_get_6_1.doStart(context, out);
+ _jettag_c_get_6_1.doEnd();
+ out.write( "RuntimeTagElement " ); //$NON-NLS-1$
+ out.write( element.getTagVariable() );
+ out.write( " = context.getTagFactory().createRuntimeTag(_jetns_" ); //$NON-NLS-1$
+ out.write( element.getNSPrefix() );
+ out.write( ", \"" ); //$NON-NLS-1$
+ out.write( element.getTagNCName() );
+ out.write( "\", \"" ); //$NON-NLS-1$
+ out.write( element.getName() );
+ out.write( "\", " ); //$NON-NLS-1$
+ out.write( element.getTagInfoVariable() );
+ out.write( "); //$NON-NLS-1$ //$NON-NLS-2$\r\n" ); //$NON-NLS-1$
+ RuntimeTagElement _jettag_c_get_7_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_7_1); //$NON-NLS-1$ //$NON-NLS-2$
+ _jettag_c_get_7_1.setRuntimeParent(null);
+ _jettag_c_get_7_1.setTagInfo(_jettd_c_get_7_1);
+ _jettag_c_get_7_1.doStart(context, out);
+ _jettag_c_get_7_1.doEnd();
+ out.write( element.getTagVariable() );
+ out.write( ".setRuntimeParent(" ); //$NON-NLS-1$
+ out.write( element.getParentTagVariable() );
+ out.write( ");\r\n" ); //$NON-NLS-1$
+ RuntimeTagElement _jettag_c_get_8_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_8_1); //$NON-NLS-1$ //$NON-NLS-2$
+ _jettag_c_get_8_1.setRuntimeParent(null);
+ _jettag_c_get_8_1.setTagInfo(_jettd_c_get_8_1);
+ _jettag_c_get_8_1.doStart(context, out);
+ _jettag_c_get_8_1.doEnd();
+ out.write( element.getTagVariable() );
+ out.write( ".setTagInfo(" ); //$NON-NLS-1$
+ out.write( element.getTagInfoVariable() );
+ out.write( ");\r\n" ); //$NON-NLS-1$
+ RuntimeTagElement _jettag_c_get_9_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_9_1); //$NON-NLS-1$ //$NON-NLS-2$
+ _jettag_c_get_9_1.setRuntimeParent(null);
+ _jettag_c_get_9_1.setTagInfo(_jettd_c_get_9_1);
+ _jettag_c_get_9_1.doStart(context, out);
+ _jettag_c_get_9_1.doEnd();
+ out.write( element.getTagVariable() );
+ out.write( ".doStart(context, out);\r\n" ); //$NON-NLS-1$
+ if(element.hasBody()) { if(element.requiresNewWriter()) { RuntimeTagElement _jettag_c_get_12_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_12_1); //$NON-NLS-1$ //$NON-NLS-2$
+ _jettag_c_get_12_1.setRuntimeParent(null);
+ _jettag_c_get_12_1.setTagInfo(_jettd_c_get_12_1);
+ _jettag_c_get_12_1.doStart(context, out);
+ _jettag_c_get_12_1.doEnd();
+ out.write( "JET2Writer " ); //$NON-NLS-1$
+ out.write( element.getTagVariable() );
+ out.write( "_saved_out = out;\r\n" ); //$NON-NLS-1$
+ } RuntimeTagElement _jettag_c_get_14_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_14_1); //$NON-NLS-1$ //$NON-NLS-2$
+ _jettag_c_get_14_1.setRuntimeParent(null);
+ _jettag_c_get_14_1.setTagInfo(_jettd_c_get_14_1);
+ _jettag_c_get_14_1.doStart(context, out);
+ _jettag_c_get_14_1.doEnd();
+ out.write( "while (" ); //$NON-NLS-1$
+ out.write( element.getTagVariable() );
+ out.write( ".okToProcessBody()) {\r\n" ); //$NON-NLS-1$
+ if(element.requiresNewWriter()) { RuntimeTagElement _jettag_c_get_16_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _jettd_c_get_16_1); //$NON-NLS-1$ //$NON-NLS-2$
+ _jettag_c_get_16_1.setRuntimeParent(null);
+ _jettag_c_get_16_1.setTagInfo(_jettd_c_get_16_1);
+ _jettag_c_get_16_1.doStart(context, out);
+ _jettag_c_get_16_1.doEnd();
+ out.write( " out = out.newNestedContentWriter();\r\n" ); //$NON-NLS-1$
+ } }
}
}
- \ No newline at end of file
diff --git a/plugins/org.eclipse.jet/templates/jet2java.jet b/plugins/org.eclipse.jet/templates/jet2java.jet
index f0ac60e..5caf940 100644
--- a/plugins/org.eclipse.jet/templates/jet2java.jet
+++ b/plugins/org.eclipse.jet/templates/jet2java.jet
@@ -34,12 +34,11 @@
}
%>
<%
- JET2CompilationUnit cu = (JET2CompilationUnit)context.getVariable("cu");
+ JET2CompilationUnit cu = (JET2CompilationUnit)context.getVariable("cu"); //$NON-NLS-1$
final JET2Declaration[] allMemberDeclarations = getAllJavaDeclarations(cu);
final XMLElement[] allXMLElements = getAllXMLTags(cu);
- final StringBuffer tagNamespaceVariables = new StringBuffer();
final TagLibraryReference[] tlRefs = cu.getTagLibraryReferences();
MethodBodyCreator generatedBody = new MethodBodyCreator(TransformContextExtender.getInstance(context).getLoader());
@@ -50,16 +49,20 @@ package <%= cu.getOutputJavaPackage() %>;
import org.eclipse.jet.JET2Context;
import org.eclipse.jet.JET2Template;
import org.eclipse.jet.JET2Writer;
+<% if( allXMLElements.length > 0) { %>
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 {
-<% for(int i = 0; i < tlRefs.length; i++ ) { %>
+<% if( allXMLElements.length > 0) { %>
+<% for(int i = 0; i < tlRefs.length; i++ ) { %>
public static final String _jetns_<%= tlRefs[i].getPrefix() %> = "<%= tlRefs[i].getTagLibraryId() %>"; //$NON-NLS-1$
+<% } %>
<% } %>
<% for(int i = 0; i < allMemberDeclarations.length; i++) { %>
@@ -72,7 +75,8 @@ public class <%= cu.getOutputJavaClassName() %> implements JET2Template {
public void generate(final JET2Context context, JET2Writer out) {
<% for(int i = 0; i < allXMLElements.length; i++) {
- context.setVariable("element", allXMLElements[i]); %>
+ context.setVariable("element", allXMLElements[i]); //$NON-NLS-1$
+%>
<c:include template="templates/tagDataDeclarations.jet"/>
<% } %>
<%= generatedBody.getBuffer() %>
diff --git a/plugins/org.eclipse.jet/templates/jet2transform.jet b/plugins/org.eclipse.jet/templates/jet2transform.jet
index 4362b29..ea9a31e 100644
--- a/plugins/org.eclipse.jet/templates/jet2transform.jet
+++ b/plugins/org.eclipse.jet/templates/jet2transform.jet
@@ -3,10 +3,9 @@
%>
<%@jet imports="java.util.Iterator"%>
<%@jet imports="java.util.Map"%>
-<%@jet imports="org.eclipse.jet.BodyContentWriter"%>
<%@jet imports="org.eclipse.jet.internal.compiler.LoaderGenerationParameters"%>
<%
-LoaderGenerationParameters parms = (LoaderGenerationParameters)context.getVariable("args");
+LoaderGenerationParameters parms = (LoaderGenerationParameters)context.getVariable("args"); //$NON-NLS-1$
Map templateMap = (Map) parms.getTemplateMap();;
%>
package <%= parms.getPackageName() %>;
diff --git a/plugins/org.eclipse.jet/templates/tagDataDeclarations.jet b/plugins/org.eclipse.jet/templates/tagDataDeclarations.jet
index 2e58db2..8bc1eab 100644
--- a/plugins/org.eclipse.jet/templates/tagDataDeclarations.jet
+++ b/plugins/org.eclipse.jet/templates/tagDataDeclarations.jet
@@ -6,7 +6,7 @@
<%
XMLElement element;
try {
- element = (XMLElement)context.getVariable("element");
+ element = (XMLElement)context.getVariable("element"); //$NON-NLS-1$
} catch( JET2TagException e) {
out.write(e.toString());
return;
diff --git a/plugins/org.eclipse.jet/templates/xmlStart.jet b/plugins/org.eclipse.jet/templates/xmlStart.jet
index c0fe1ba..41de6b8 100644
--- a/plugins/org.eclipse.jet/templates/xmlStart.jet
+++ b/plugins/org.eclipse.jet/templates/xmlStart.jet
@@ -3,7 +3,7 @@
<%
GenXMLElement element = (GenXMLElement) context.getVariable("element"); //$NON-NLS-1$
%>
-<c:get select="$indent"/>RuntimeTagElement <%= element.getTagVariable() %> = context.getTagFactory().createRuntimeTag(_jetns_<%= element.getNSPrefix() %>, "<%= element.getTagNCName() %>", "<%= element.getName() %>", <%= element.getTagInfoVariable() %>);
+<c:get select="$indent"/>RuntimeTagElement <%= element.getTagVariable() %> = context.getTagFactory().createRuntimeTag(_jetns_<%= element.getNSPrefix() %>, "<%= element.getTagNCName() %>", "<%= element.getName() %>", <%= element.getTagInfoVariable() %>); //$NON-NLS-1$ //$NON-NLS-2$
<c:get select="$indent"/><%= element.getTagVariable() %>.setRuntimeParent(<%= element.getParentTagVariable() %>);
<c:get select="$indent"/><%= element.getTagVariable() %>.setTagInfo(<%= element.getTagInfoVariable() %>);
<c:get select="$indent"/><%= element.getTagVariable() %>.doStart(context, out);
diff --git a/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar b/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar
index 3dce716..5af4bbb 100644
--- a/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar
+++ b/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar
Binary files differ
diff --git a/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar b/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar
index 94000dd..1bf6f9b 100644
--- a/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar
+++ b/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar
Binary files differ
diff --git a/tests/org.eclipse.jet.tests/data/taglibs.jet.expected.java b/tests/org.eclipse.jet.tests/data/taglibs.jet.expected.java
index 388b5fd..2611bf7 100644
--- a/tests/org.eclipse.jet.tests/data/taglibs.jet.expected.java
+++ b/tests/org.eclipse.jet.tests/data/taglibs.jet.expected.java
@@ -59,13 +59,13 @@ public class X implements JET2Template {
new String[] {
} );
out.write( "\r\n\"isAllUpper\", \"nl\", \"other\", \"tokenize\", \"upper\"\r\n\r\n" ); //$NON-NLS-1$
- RuntimeTagElement _jettag_test_tokenize_4_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "tokenize", "test:tokenize", _jettd_test_tokenize_4_1);
+ RuntimeTagElement _jettag_test_tokenize_4_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "tokenize", "test:tokenize", _jettd_test_tokenize_4_1); //$NON-NLS-1$ //$NON-NLS-2$
_jettag_test_tokenize_4_1.setRuntimeParent(null);
_jettag_test_tokenize_4_1.setTagInfo(_jettd_test_tokenize_4_1);
_jettag_test_tokenize_4_1.doStart(context, out);
while (_jettag_test_tokenize_4_1.okToProcessBody()) {
out.write( "\r\n" ); //$NON-NLS-1$
- RuntimeTagElement _jettag_test_other_5_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "other", "test:other", _jettd_test_other_5_1);
+ RuntimeTagElement _jettag_test_other_5_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "other", "test:other", _jettd_test_other_5_1); //$NON-NLS-1$ //$NON-NLS-2$
_jettag_test_other_5_1.setRuntimeParent(_jettag_test_tokenize_4_1);
_jettag_test_other_5_1.setTagInfo(_jettd_test_other_5_1);
_jettag_test_other_5_1.doStart(context, out);
@@ -75,7 +75,7 @@ public class X implements JET2Template {
}
_jettag_test_other_5_1.doEnd();
out.write( "\r\n" ); //$NON-NLS-1$
- RuntimeTagElement _jettag_test_isAllUpper_6_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "isAllUpper", "test:isAllUpper", _jettd_test_isAllUpper_6_1);
+ RuntimeTagElement _jettag_test_isAllUpper_6_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "isAllUpper", "test:isAllUpper", _jettd_test_isAllUpper_6_1); //$NON-NLS-1$ //$NON-NLS-2$
_jettag_test_isAllUpper_6_1.setRuntimeParent(_jettag_test_tokenize_4_1);
_jettag_test_isAllUpper_6_1.setTagInfo(_jettd_test_isAllUpper_6_1);
_jettag_test_isAllUpper_6_1.doStart(context, out);
@@ -85,7 +85,7 @@ public class X implements JET2Template {
}
_jettag_test_isAllUpper_6_1.doEnd();
out.write( "\r\n" ); //$NON-NLS-1$
- RuntimeTagElement _jettag_test_upper_8_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "upper", "test:upper", _jettd_test_upper_8_1);
+ RuntimeTagElement _jettag_test_upper_8_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "upper", "test:upper", _jettd_test_upper_8_1); //$NON-NLS-1$ //$NON-NLS-2$
_jettag_test_upper_8_1.setRuntimeParent(_jettag_test_tokenize_4_1);
_jettag_test_upper_8_1.setTagInfo(_jettd_test_upper_8_1);
_jettag_test_upper_8_1.doStart(context, out);
@@ -97,13 +97,13 @@ public class X implements JET2Template {
}
out = _jettag_test_upper_8_1_saved_out;
_jettag_test_upper_8_1.doEnd();
- RuntimeTagElement _jettag_test_nl_8_29 = context.getTagFactory().createRuntimeTag(_jetns_test, "nl", "test:nl", _jettd_test_nl_8_29);
+ RuntimeTagElement _jettag_test_nl_8_29 = context.getTagFactory().createRuntimeTag(_jetns_test, "nl", "test:nl", _jettd_test_nl_8_29); //$NON-NLS-1$ //$NON-NLS-2$
_jettag_test_nl_8_29.setRuntimeParent(_jettag_test_tokenize_4_1);
_jettag_test_nl_8_29.setTagInfo(_jettd_test_nl_8_29);
_jettag_test_nl_8_29.doStart(context, out);
_jettag_test_nl_8_29.doEnd();
out.write( "\r\n" ); //$NON-NLS-1$
- RuntimeTagElement _jettag_test_other_9_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "other", "test:other", _jettd_test_other_9_1);
+ RuntimeTagElement _jettag_test_other_9_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "other", "test:other", _jettd_test_other_9_1); //$NON-NLS-1$ //$NON-NLS-2$
_jettag_test_other_9_1.setRuntimeParent(_jettag_test_tokenize_4_1);
_jettag_test_other_9_1.setTagInfo(_jettd_test_other_9_1);
_jettag_test_other_9_1.doStart(context, out);