Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.jet/templates/tagDataDeclarations.jet')
-rw-r--r--plugins/org.eclipse.jet/templates/tagDataDeclarations.jet30
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/org.eclipse.jet/templates/tagDataDeclarations.jet b/plugins/org.eclipse.jet/templates/tagDataDeclarations.jet
new file mode 100644
index 0000000..2e58db2
--- /dev/null
+++ b/plugins/org.eclipse.jet/templates/tagDataDeclarations.jet
@@ -0,0 +1,30 @@
+<%@jet class="TagDataDeclGenerator"%>
+<%@jet imports="java.util.Iterator"%>
+<%@jet imports="org.eclipse.jet.taglib.JET2TagException"%>
+<%@jet imports="org.eclipse.jet.compiler.XMLElement"%>
+<%@jet imports="org.eclipse.jet.internal.compiler.MethodBodyCreator"%>
+<%
+ XMLElement element;
+ try {
+ element = (XMLElement)context.getVariable("element");
+ } catch( JET2TagException e) {
+ out.write(e.toString());
+ return;
+ }
+
+ String varName = MethodBodyCreator.tagInfoVariableName(element);
+%>
+ final TagInfo <%= varName %> = new TagInfo("<%=element.getName()%>", //$NON-NLS-1$
+ <%= element.getLine() %>, <%= element.getColumn() %>,
+ new String[] {
+<% for (Iterator i = element.getAttributes().keySet().iterator(); i.hasNext();) {
+ String attrName = (String) i.next(); %>
+ "<%= attrName %>", //$NON-NLS-1$
+<% } %>
+ },
+ new String[] {
+<% for (Iterator i = element.getAttributes().values().iterator(); i.hasNext();) {
+ String attrValue = (String) i.next(); %>
+ "<%= attrValue %>", //$NON-NLS-1$
+<% } %>
+ } );

Back to the top