summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2007-05-17 10:57:33 (EDT)
committerpelder2007-05-17 10:57:33 (EDT)
commit52f40316247d76430ab2a4f3b07bbdc1f87fe034 (patch)
treedeaf2cffdd39300e8f99d7d01e777528d22f9208
parent02a00ad003b0b6e2c38a542de3e2f10e736d322e (diff)
downloadorg.eclipse.jet-52f40316247d76430ab2a4f3b07bbdc1f87fe034.zip
org.eclipse.jet-52f40316247d76430ab2a4f3b07bbdc1f87fe034.tar.gz
org.eclipse.jet-52f40316247d76430ab2a4f3b07bbdc1f87fe034.tar.bz2
[187555,187552] Generated _TAGS_ class only makes Java output larger
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java14
-rw-r--r--plugins/org.eclipse.jet/templates/v2/jet2java.jet12
2 files changed, 10 insertions, 16 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java
index 0968a6e..40b1b76 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java
@@ -98,8 +98,6 @@ public class JET2JavaGeneratorNew implements JET2Template {
if(tuv.hasTags()) {
out.write(" "); //$NON-NLS-1$
out.write(NL);
- out.write(" private static final class _TAGS {"); //$NON-NLS-1$
- out.write(NL);
cu.accept(new V2CodeGenVisitor(context,out, " ") { //$NON-NLS-1$
public boolean visit(XMLBodyElement e) {
doElementVisit(e);
@@ -111,7 +109,7 @@ public class JET2JavaGeneratorNew implements JET2Template {
}
public void doElementVisit(XMLElement e) {
- out.write(" static final TagInfo "); //$NON-NLS-1$
+ out.write(" private static final TagInfo _td_"); //$NON-NLS-1$
out.write( tagInfoVar(e) );
out.write(" = new TagInfo(\""); //$NON-NLS-1$
out.write(e.getName());
@@ -146,8 +144,6 @@ public class JET2JavaGeneratorNew implements JET2Template {
out.write(NL);
}
});
- out.write(" }"); //$NON-NLS-1$
- out.write(NL);
}
out.write(NL);
out.write(" public void generate(final JET2Context context, final JET2Writer __out) {"); //$NON-NLS-1$
@@ -200,7 +196,7 @@ public class JET2JavaGeneratorNew implements JET2Template {
out.write( e.getTagNCName() );
out.write("\", \""); //$NON-NLS-1$
out.write( e.getName() );
- out.write("\", _TAGS."); //$NON-NLS-1$
+ out.write("\", _td_"); //$NON-NLS-1$
out.write( tagInfoVar(e) );
out.write("); //$NON-NLS-1$ //$NON-NLS-2$"); //$NON-NLS-1$
out.write(NL);
@@ -212,7 +208,7 @@ public class JET2JavaGeneratorNew implements JET2Template {
out.write(NL);
out.write(" "); //$NON-NLS-1$
out.write( tagVar(e) );
- out.write(".setTagInfo(_TAGS."); //$NON-NLS-1$
+ out.write(".setTagInfo(_td_"); //$NON-NLS-1$
out.write( tagInfoVar(e) );
out.write(");"); //$NON-NLS-1$
out.write(NL);
@@ -270,7 +266,7 @@ public class JET2JavaGeneratorNew implements JET2Template {
out.write( e.getTagNCName() );
out.write("\", \""); //$NON-NLS-1$
out.write( e.getName() );
- out.write("\", _TAGS."); //$NON-NLS-1$
+ out.write("\", _td_"); //$NON-NLS-1$
out.write( tagInfoVar(e) );
out.write("); //$NON-NLS-1$ //$NON-NLS-2$"); //$NON-NLS-1$
out.write(NL);
@@ -282,7 +278,7 @@ public class JET2JavaGeneratorNew implements JET2Template {
out.write(NL);
out.write(" "); //$NON-NLS-1$
out.write( tagVar(e) );
- out.write(".setTagInfo(_TAGS."); //$NON-NLS-1$
+ out.write(".setTagInfo(_td_"); //$NON-NLS-1$
out.write( tagInfoVar(e) );
out.write(");"); //$NON-NLS-1$
out.write(NL);
diff --git a/plugins/org.eclipse.jet/templates/v2/jet2java.jet b/plugins/org.eclipse.jet/templates/v2/jet2java.jet
index f271ce0..9c74a2e 100644
--- a/plugins/org.eclipse.jet/templates/v2/jet2java.jet
+++ b/plugins/org.eclipse.jet/templates/v2/jet2java.jet
@@ -55,7 +55,6 @@ public class <%= cu.getOutputJavaClassName() %> implements JET2Template {
private static final String <%=nlConstantName%> = System.getProperties().getProperty("line.separator"); //$NON-NLS-1$
<% if(tuv.hasTags()) { %>
- private static final class _TAGS {
<% cu.accept(new V2CodeGenVisitor(context,out, " ") { //$NON-NLS-1$
public boolean visit(XMLBodyElement e) {
doElementVisit(e);
@@ -67,7 +66,7 @@ public class <%= cu.getOutputJavaClassName() %> implements JET2Template {
}
public void doElementVisit(XMLElement e) {
%>
- static final TagInfo <%= tagInfoVar(e) %> = new TagInfo("<%=e.getName()%>", //$NON-NLS-1$
+ private static final TagInfo _td_<%= tagInfoVar(e) %> = new TagInfo("<%=e.getName()%>", //$NON-NLS-1$
<%= e.getLine() %>, <%= e.getColumn() %>,
new String[] {
<% for (Iterator i = e.getAttributes().keySet().iterator(); i.hasNext();) { %>
@@ -82,7 +81,6 @@ public class <%= cu.getOutputJavaClassName() %> implements JET2Template {
} );
<% }
}); %>
- }
<% } %>
public void generate(final JET2Context context, final JET2Writer __out) {
@@ -113,9 +111,9 @@ public class <%= cu.getOutputJavaClassName() %> implements JET2Template {
}
public boolean visit(XMLBodyElement e) {
%>
- RuntimeTagElement <%= tagVar(e) %> = context.getTagFactory().createRuntimeTag(_jetns_<%= e.getNSPrefix() %>, "<%= e.getTagNCName() %>", "<%= e.getName() %>", _TAGS.<%= tagInfoVar(e) %>); //$NON-NLS-1$ //$NON-NLS-2$
+ RuntimeTagElement <%= tagVar(e) %> = context.getTagFactory().createRuntimeTag(_jetns_<%= e.getNSPrefix() %>, "<%= e.getTagNCName() %>", "<%= e.getName() %>", _td_<%= tagInfoVar(e) %>); //$NON-NLS-1$ //$NON-NLS-2$
<%= tagVar(e) %>.setRuntimeParent(<%= parentTagVar(e) %>);
- <%= tagVar(e) %>.setTagInfo(_TAGS.<%= tagInfoVar(e) %>);
+ <%= tagVar(e) %>.setTagInfo(_td_<%= tagInfoVar(e) %>);
<%= tagVar(e) %>.doStart(context, out);
<% if(requiresOwnWriter(e)) { %>
JET2Writer <%= tagVar(e) %>_saved_out = out;
@@ -142,9 +140,9 @@ public class <%= cu.getOutputJavaClassName() %> implements JET2Template {
}
public boolean visit(XMLEmptyElement e) {
%>
- RuntimeTagElement <%= tagVar(e) %> = context.getTagFactory().createRuntimeTag(_jetns_<%= e.getNSPrefix() %>, "<%= e.getTagNCName() %>", "<%= e.getName() %>", _TAGS.<%= tagInfoVar(e) %>); //$NON-NLS-1$ //$NON-NLS-2$
+ RuntimeTagElement <%= tagVar(e) %> = context.getTagFactory().createRuntimeTag(_jetns_<%= e.getNSPrefix() %>, "<%= e.getTagNCName() %>", "<%= e.getName() %>", _td_<%= tagInfoVar(e) %>); //$NON-NLS-1$ //$NON-NLS-2$
<%= tagVar(e) %>.setRuntimeParent(<%= parentTagVar(e) %>);
- <%= tagVar(e) %>.setTagInfo(_TAGS.<%= tagInfoVar(e) %>);
+ <%= tagVar(e) %>.setTagInfo(_td_<%= tagInfoVar(e) %>);
<%= tagVar(e) %>.doStart(context, out);
<%= tagVar(e) %>.doEnd();
<%