Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'transforms/org.eclipse.jet.transforms.tagfactory/templates')
-rw-r--r--transforms/org.eclipse.jet.transforms.tagfactory/templates/dump.jet2
-rw-r--r--transforms/org.eclipse.jet.transforms.tagfactory/templates/main.jet45
-rw-r--r--transforms/org.eclipse.jet.transforms.tagfactory/templates/tagLibrary/tagFactory.java.jet56
3 files changed, 0 insertions, 103 deletions
diff --git a/transforms/org.eclipse.jet.transforms.tagfactory/templates/dump.jet b/transforms/org.eclipse.jet.transforms.tagfactory/templates/dump.jet
deleted file mode 100644
index 5ced365..0000000
--- a/transforms/org.eclipse.jet.transforms.tagfactory/templates/dump.jet
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<c:dump select="/*" format="true" entities="true"/>
diff --git a/transforms/org.eclipse.jet.transforms.tagfactory/templates/main.jet b/transforms/org.eclipse.jet.transforms.tagfactory/templates/main.jet
deleted file mode 100644
index 70a2c8c..0000000
--- a/transforms/org.eclipse.jet.transforms.tagfactory/templates/main.jet
+++ /dev/null
@@ -1,45 +0,0 @@
-<%@taglib prefix="ws" id="org.eclipse.jet.workspaceTags" %>
-<%-- Main entry point for org.eclipse.jet.transforms.tagfactory --%>
-
-<c:setVariable var="plugin" select="/plugin"/>
-<%--
-TODO: traverse input model, performing calculations and storing
-the results as model annotations via c:set tag
---%>
-<c:iterate select="$plugin/extension[@point='org.eclipse.jet.tagLibraries']" var="extension">
- <c:iterate select="$extension/tagLibrary[@tagFactory]" var="tagLibrary">
- <c:setVariable var="ordinal" select="1"/>
- <c:set select="$tagLibrary" name="numTags"><c:get select="count($tagLibrary/*['Tag' = substring(local-name(), string-length(local-name()) - 2, 3)])"/></c:set>
- <c:set select="$tagLibrary" name="pkgFactory"><c:get select="packageName($tagLibrary/@tagFactory)"/></c:set>
- <c:set select="$tagLibrary" name="clsFactory"><c:get select="className($tagLibrary/@tagFactory)"/></c:set>
- <c:iterate select="$tagLibrary/*['Tag' = substring(local-name(), string-length(local-name()) - 2, 3)]" var="tag">
- <c:set select="$tag" name="ordinal"><c:get select="$ordinal"/></c:set>
- <c:setVariable var="ordinal" select="$ordinal + 1"/>
- </c:iterate>
- </c:iterate>
-</c:iterate>
-
-
-<%--
-TODO: traverse annotated model, performing text generation actions
-such as ws:file, ws:folder and ws:project
---%>
-<c:iterate select="$plugin/extension[@point='org.eclipse.jet.tagLibraries']" var="extension">
- <c:iterate select="$extension/tagLibrary[@tagFactory]" var="tagLibrary">
- <java:class srcFolder="{$org.eclipse.jet.resource.project.name}/src"
- package="{$tagLibrary/@pkgFactory}"
- name="{$tagLibrary/@clsFactory}"
- template="templates/tagLibrary/tagFactory.java.jet"/>
- </c:iterate>
-</c:iterate>
-
-
-<%-- For debug purposes, dump the annotated input model in
- the root of the project containing the original input model.
-
- Note that model formatting may not be identical, and that in
- the case of non-XML input models, the dump may look quite different.
-
-<ws:file template="templates/dump.jet" path="{$org.eclipse.jet.resource.project.name}/dump.xml"/>
---%>
-
diff --git a/transforms/org.eclipse.jet.transforms.tagfactory/templates/tagLibrary/tagFactory.java.jet b/transforms/org.eclipse.jet.transforms.tagfactory/templates/tagLibrary/tagFactory.java.jet
deleted file mode 100644
index f5e17fd..0000000
--- a/transforms/org.eclipse.jet.transforms.tagfactory/templates/tagLibrary/tagFactory.java.jet
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- *
- * Copyright (c) <f:formatNow pattern="yyyy"/> IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- */
-package <c:get select="$tagLibrary/@pkgFactory"/>;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jet.taglib.CustomTag;
-import org.eclipse.jet.taglib.JET2TagException;
-import org.eclipse.jet.taglib.TagInstanceFactory;
-
-/**
- * Tag Factory for <c:get select="$tagLibrary/@id"/>
- */
-public class <c:get select="$tagLibrary/@clsFactory"/> implements TagInstanceFactory
-{
-
- private final Map tagOrdinalByName;
-
- /**
- *
- */
- public <c:get select="$tagLibrary/@clsFactory"/>()
- {
- tagOrdinalByName = new HashMap(<c:get select="$tagLibrary/@numTags"/>);
-
-<c:iterate select="$tagLibrary/*['Tag' = substring(local-name(), string-length(local-name()) - 2, 3)]" var="tag">
- tagOrdinalByName.put("<c:get select="$tag/@name"/>",new Integer(<c:get select="$tag/@ordinal"/>)); //$NON-NLS-1$
-</c:iterate>
- }
-
- public CustomTag createCustomTag(String name)
- {
- Integer ordinal = (Integer)tagOrdinalByName.get(name);
-
- switch(ordinal == null ? 0 : ordinal.intValue()) {
-<c:iterate select="$tagLibrary/*['Tag' = substring(local-name(), string-length(local-name()) - 2, 3)]" var="tag">
- case <c:get select="$tag/@ordinal"/>: // <c:get select="$tag/@name"/>
- return new <c:get select="$tag/@class"/>();
-</c:iterate>
- default:
- throw new JET2TagException("Unknown Tag: " + name); //$NON-NLS-1$
- }
- }
-
-}

Back to the top