Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsshaw2005-08-29 23:26:45 -0400
committersshaw2005-08-29 23:26:45 -0400
commitb03bcb6fca128390bdbf0d090ae6c8391920c7ab (patch)
tree5e9e95635628ae0627b1d3afc59796d0cad25126 /doc/org.eclipse.gmf.runtime.doclet
parent2e59aa6d702863f82997fba2a1abab7c5dd06c54 (diff)
downloadorg.eclipse.gmf-tooling-b03bcb6fca128390bdbf0d090ae6c8391920c7ab.tar.gz
org.eclipse.gmf-tooling-b03bcb6fca128390bdbf0d090ae6c8391920c7ab.tar.xz
org.eclipse.gmf-tooling-b03bcb6fca128390bdbf0d090ae6c8391920c7ab.zip
Refactoring of the IBM gmf runtime contribution to the org.eclipse.gmf.runtime namespace.
Diffstat (limited to 'doc/org.eclipse.gmf.runtime.doclet')
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/.classpath7
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/.cvsignore2
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/.externalToolBuilders/Build JAR.launch13
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/.project27
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/build.properties12
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/build.xml8
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/AuroraDoclet.java346
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/ITagDefinitions.java22
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ClassDocProxy.java210
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ComparableProxy.java37
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ConstructorDocProxy.java37
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/DocProxy.java192
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ExecutableMemberDocProxy.java91
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/FieldDocProxy.java75
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/MemberDocProxy.java38
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/MethodDocProxy.java61
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/PackageDocProxy.java82
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ParamTagProxy.java45
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ParameterProxy.java53
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProgramElementDocProxy.java110
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/Proxy.java33
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProxyFactory.java909
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProxyRegistry.java34
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProxyUtil.java25
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/RootDocProxy.java248
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/SeeTagProxy.java76
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/SerialFieldTagProxy.java73
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/TagProxy.java82
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ThrowsTagProxy.java53
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/TypeProxy.java59
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/utils/AliasRegistry.java34
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/utils/MapsGenerator.java177
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/utils/NamespaceChecker.java127
-rw-r--r--doc/org.eclipse.gmf.runtime.doclet/tools.jarbin0 -> 5082034 bytes
34 files changed, 3398 insertions, 0 deletions
diff --git a/doc/org.eclipse.gmf.runtime.doclet/.classpath b/doc/org.eclipse.gmf.runtime.doclet/.classpath
new file mode 100644
index 000000000..74300d7df
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="tools.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/doc/org.eclipse.gmf.runtime.doclet/.cvsignore b/doc/org.eclipse.gmf.runtime.doclet/.cvsignore
new file mode 100644
index 000000000..1b9cf9fdc
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/.cvsignore
@@ -0,0 +1,2 @@
+bin
+aurora-doclet.jar
diff --git a/doc/org.eclipse.gmf.runtime.doclet/.externalToolBuilders/Build JAR.launch b/doc/org.eclipse.gmf.runtime.doclet/.externalToolBuilders/Build JAR.launch
new file mode 100644
index 000000000..41bdd32e4
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/.externalToolBuilders/Build JAR.launch
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/org.eclipse.gmf.runtime.doclet}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.gmf.runtime.doclet/build.xml}"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<booleanAttribute key="org.eclipse.debug.core.ATTR_REFRESH_RECURSIVE" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+</launchConfiguration>
diff --git a/doc/org.eclipse.gmf.runtime.doclet/.project b/doc/org.eclipse.gmf.runtime.doclet/.project
new file mode 100644
index 000000000..6c24dc809
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/.project
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.gmf.runtime.doclet</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>LaunchConfigHandle</key>
+ <value>&lt;project&gt;/.externalToolBuilders/Build JAR.launch</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/doc/org.eclipse.gmf.runtime.doclet/build.properties b/doc/org.eclipse.gmf.runtime.doclet/build.properties
new file mode 100644
index 000000000..9d5cc07f8
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/build.properties
@@ -0,0 +1,12 @@
+jars.compile.order = aurora-doclet.jar
+source.aurora-doclet.jar = src/
+output.aurora-doclet.jar = bin/
+bin.includes = tools.jar,\
+ aurora-doclet.jar
+src.includes = src/,\
+ build.xml,\
+ build.properties,\
+ .project,\
+ .externalToolBuilders/,\
+ tools.jar,\
+ .classpath
diff --git a/doc/org.eclipse.gmf.runtime.doclet/build.xml b/doc/org.eclipse.gmf.runtime.doclet/build.xml
new file mode 100644
index 000000000..d299c6c5b
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/build.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project default="jar" basedir=".">
+
+ <target name="jar">
+ <jar destfile="${basedir}/aurora-doclet.jar" basedir="${basedir}/bin"/>
+ </target>
+
+</project>
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/AuroraDoclet.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/AuroraDoclet.java
new file mode 100644
index 000000000..a8d5164d8
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/AuroraDoclet.java
@@ -0,0 +1,346 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.text.Collator;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.TreeSet;
+
+import org.eclipse.gmf.runtime.doclet.proxies.ProxyFactory;
+import org.eclipse.gmf.runtime.doclet.utils.AliasRegistry;
+import org.eclipse.gmf.runtime.doclet.utils.MapsGenerator;
+import org.eclipse.gmf.runtime.doclet.utils.NamespaceChecker;
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.DocErrorReporter;
+import com.sun.javadoc.PackageDoc;
+import com.sun.javadoc.RootDoc;
+import com.sun.tools.doclets.standard.Standard;
+
+/**
+ * Main entry point of the Aurora doclet, this doclet offers support for the
+ * special namespace-based accessibility rules and generates Eclipse TOC for
+ * exported packages
+ */
+public class AuroraDoclet
+ extends Standard {
+
+ private static final String CMDLINE_OPTION_CLIENT_CONTEXT = "-clientContext"; //$NON-NLS-1$
+
+ private static final String CMDLINE_OPTION_NAMESPACE_ALIAS = "-namespaceAlias"; //$NON-NLS-1$
+
+ private static final String CMDLINE_OPTION_NAMESPACE_ALIASES = "-namespaceAliases"; //$NON-NLS-1$
+
+ private static final String CMDLINE_OPTION_TOC_FILENAME = "-tocFilename"; //$NON-NLS-1$
+
+ private static final String CMDLINE_OPTION_TOC_REF_PREFIX = "-tocRefPrefix"; //$NON-NLS-1$
+
+ private static final String CMDLINE_OPTION_TOC_TITLE = "-tocTitle"; //$NON-NLS-1$
+
+ private static final String CMDLINE_OPTION_TOC_LINK_TO = "-tocLinkTo"; //$NON-NLS-1$
+
+ private static String clientContext = ""; //$NON-NLS-1$
+
+ private static NamespaceChecker namespaceChecker = null;
+
+ private static AliasRegistry aliasRegistry = null;
+
+ private static File tocFile = null;
+
+ private static String tocRefPrefix = "reference/api/"; //$NON-NLS-1$
+
+ private static String tocTitle = ""; //$NON-NLS-1$
+
+ private static String tocLinkTo = ""; //$NON-NLS-1$
+
+ public static boolean start(RootDoc root)
+ throws IOException {
+
+ readOptions(root.options(), root);
+ RootDoc rootDocProxy = getRootDocProxy(root);
+ boolean startRet = Standard.start(rootDocProxy);
+ outputToc(rootDocProxy);
+
+ return startRet;
+ }
+
+ public static int optionLength(String option) {
+
+ if (option.equals(CMDLINE_OPTION_CLIENT_CONTEXT)) {
+ return 2;
+ }
+ if (option.equals(CMDLINE_OPTION_NAMESPACE_ALIAS)) {
+ return 2;
+ }
+ if (option.equals(CMDLINE_OPTION_NAMESPACE_ALIASES)) {
+ return 2;
+ }
+ if (option.equals(CMDLINE_OPTION_TOC_FILENAME)) {
+ return 2;
+ }
+ if (option.equals(CMDLINE_OPTION_TOC_REF_PREFIX)) {
+ return 2;
+ }
+ if (option.equals(CMDLINE_OPTION_TOC_TITLE)) {
+ return 2;
+ }
+ if (option.equals(CMDLINE_OPTION_TOC_LINK_TO)) {
+ return 2;
+ }
+ return Standard.optionLength(option);
+ }
+
+ public static boolean validOptions(String options[][],
+ DocErrorReporter reporter)
+ throws IOException {
+
+ boolean foundClientContextOption = false;
+
+ for (int i = 0; i < options.length; i++) {
+ String[] opt = options[i];
+
+ if (opt[0].equals(CMDLINE_OPTION_CLIENT_CONTEXT)) {
+ if (foundClientContextOption) {
+ reporter
+ .printError("Only one " + CMDLINE_OPTION_CLIENT_CONTEXT + " option allowed."); //$NON-NLS-1$ //$NON-NLS-2$
+ return false;
+ } else {
+ foundClientContextOption = true;
+ }
+ } else if (opt[0].equals(CMDLINE_OPTION_NAMESPACE_ALIAS)) {
+ String arg = opt[1];
+ int equalPos = arg.indexOf('=');
+ if (equalPos <= 0 || equalPos >= arg.length() - 2) {
+ reporter
+ .printError("Invalid " + CMDLINE_OPTION_NAMESPACE_ALIAS + ": " + arg); //$NON-NLS-1$ //$NON-NLS-2$
+ return false;
+ }
+ } else if (opt[0].equals(CMDLINE_OPTION_NAMESPACE_ALIASES)) {
+ String arg = opt[1];
+ File file = new File(arg);
+ if (!file.exists()) {
+ reporter
+ .printError("No such file in " + CMDLINE_OPTION_NAMESPACE_ALIASES + ": " + arg); //$NON-NLS-1$ //$NON-NLS-2$
+ return false;
+ }
+ } else if (opt[0].equals(CMDLINE_OPTION_TOC_FILENAME)) {
+ String arg = opt[1];
+ if (arg == null || arg.length() == 0) {
+ reporter
+ .printError("Unable to create TOC file: \"" + arg + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ return false;
+ } else {
+ File file = new File(arg);
+ if (file.isDirectory()) {
+ reporter
+ .printError("Unable to create TOC file: \"" + arg + "\" is a directory"); //$NON-NLS-1$ //$NON-NLS-2$
+ return false;
+ }
+ }
+ } else if (opt[0].equals(CMDLINE_OPTION_TOC_REF_PREFIX)) {
+ String arg = opt[1];
+ if (arg == null || arg.length() == 0) {
+ reporter
+ .printError("Invalid " + CMDLINE_OPTION_TOC_REF_PREFIX + ": " + arg); //$NON-NLS-1$ //$NON-NLS-2$
+ return false;
+ }
+ } else if (opt[0].equals(CMDLINE_OPTION_TOC_TITLE)) {
+ String arg = opt[1];
+ if (arg == null || arg.length() == 0) {
+ reporter
+ .printError("Invalid " + CMDLINE_OPTION_TOC_TITLE + ": " + arg); //$NON-NLS-1$ //$NON-NLS-2$
+ return false;
+ }
+ }
+ }
+
+ return Standard.validOptions(options, reporter);
+ }
+
+ private static void readOptions(String[][] options,
+ DocErrorReporter reporter) {
+
+ aliasRegistry = new AliasRegistry();
+
+ for (int i = 0; i < options.length; i++) {
+ String[] opt = options[i];
+ if (opt[0].equals(CMDLINE_OPTION_CLIENT_CONTEXT)) {
+ clientContext = opt[1];
+ } else if (opt[0].equals(CMDLINE_OPTION_NAMESPACE_ALIAS)) {
+ String arg = opt[1];
+ int equalPos = arg.indexOf('=');
+ if (equalPos > 0 && equalPos < arg.length() - 2) {
+ String alias = arg.substring(0, equalPos);
+ String value = arg.substring(equalPos + 1);
+ aliasRegistry.registerAlias(alias, value);
+ }
+ } else if (opt[0].equals(CMDLINE_OPTION_NAMESPACE_ALIASES)) {
+ readNamespaceAliases(opt[1], reporter);
+ } else if (opt[0].equals(CMDLINE_OPTION_TOC_FILENAME)) {
+ String arg = opt[1];
+ File file = new File(arg);
+ try {
+ file.delete();
+ if (file.createNewFile()) {
+ tocFile = file;
+ reporter
+ .printNotice("TOC Pathname: " + file.getAbsolutePath()); //$NON-NLS-1$
+ }
+ } catch (IOException e) {
+ reporter
+ .printError("Could not create TOC file: \"" + arg + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ } else if (opt[0].equals(CMDLINE_OPTION_TOC_REF_PREFIX)) {
+ tocRefPrefix = opt[1];
+ reporter.printNotice("TOC REF Prefix: " + tocRefPrefix); //$NON-NLS-1$
+ } else if (opt[0].equals(CMDLINE_OPTION_TOC_TITLE)) {
+ tocTitle = opt[1];
+ reporter.printNotice("TOC Title: " + tocTitle); //$NON-NLS-1$
+ } else if (opt[0].equals(CMDLINE_OPTION_TOC_LINK_TO)) {
+ tocLinkTo = opt[1].trim();
+ reporter.printNotice("TOC Link To: " + tocLinkTo); //$NON-NLS-1$
+ }
+ }
+
+ /* Check for alias for the client context */
+ String aliasValue = getAliasRegistry().getAliasValue(clientContext);
+ if (aliasValue != null) {
+ clientContext = aliasValue;
+ }
+
+ }
+
+ private static void readNamespaceAliases(String fileName,
+ DocErrorReporter reporter) {
+ Properties namespaceAliases = new Properties();
+
+ try {
+ FileInputStream fis = new FileInputStream(fileName);
+ namespaceAliases.load(fis);
+ fis.close();
+
+ for (Iterator iter = namespaceAliases.entrySet().iterator(); iter
+ .hasNext();) {
+ Map.Entry next = (Map.Entry) iter.next();
+
+ aliasRegistry.registerAlias((String) next.getKey(),
+ (String) next.getValue());
+ }
+ } catch (IOException e) {
+ reporter
+ .printError("Could not read namespace aliases from " + fileName //$NON-NLS-1$
+ + ": " + e.getLocalizedMessage()); //$NON-NLS-1$
+ }
+ }
+
+ public static NamespaceChecker getNamespaceChecker() {
+ return namespaceChecker;
+ }
+
+ public static AliasRegistry getAliasRegistry() {
+ return aliasRegistry;
+ }
+
+ private static RootDoc getRootDocProxy(RootDoc root) {
+
+ MapsGenerator mapGenerator = new MapsGenerator(root, getAliasRegistry());
+
+ namespaceChecker = new NamespaceChecker(clientContext, mapGenerator
+ .getCanBeSeeByMap());
+
+ RootDoc retRootDoc = ProxyFactory.getInstance()
+ .createRootDocProxy(root);
+ // printOptions(retRootDoc.options());
+ return retRootDoc;
+ }
+
+ private static void outputToc(RootDoc rootDoc) {
+ if (tocFile == null)
+ return;
+
+ try {
+ FileOutputStream fos = new FileOutputStream(tocFile);
+ PrintWriter pw = new PrintWriter(fos);
+ pw.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
+ pw.println("<?NLS TYPE=\"org.eclipse.help.toc\"?>"); //$NON-NLS-1$
+ pw.println();
+
+ String linkToText = ""; //$NON-NLS-1$
+ if (tocLinkTo.length() > 0) {
+ linkToText = " link_to=\"" + tocLinkTo + "\""; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ String tocText = "<toc" + linkToText + " label=\"" + tocTitle + "\" href=\"" + tocRefPrefix + "overview-summary.html\">"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ pw.println(tocText);
+
+ pw.println("\t<topic label=\"" + tocTitle + "\" href=\"" + tocRefPrefix + "overview-summary.html\">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ /* Gather list of packages and sort by name */
+ TreeSet treeSet = new TreeSet(Collator.getInstance());
+ ClassDoc classDocs[] = rootDoc.classes();
+ if (classDocs != null) {
+ for (int i = 0; i < classDocs.length; i++) {
+ ClassDoc classDoc = classDocs[i];
+ PackageDoc packageDoc = classDoc.containingPackage();
+ if (packageDoc != null) {
+ treeSet.add(packageDoc.name());
+ }
+ }
+ }
+
+ /* Iterate over each package name and output a topic entry */
+ for (Iterator iter = treeSet.iterator(); iter.hasNext();) {
+ String packageName = (String) iter.next();
+ String packagePath = packageName.replace('.', '/');
+ pw
+ .println("\t\t<topic label=\"" + packageName + "\" href=\"" + tocRefPrefix + packagePath + "/package-summary.html\" />"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ pw.println("\t</topic>"); //$NON-NLS-1$
+ pw.println("</toc>"); //$NON-NLS-1$
+
+ pw.close();
+
+ } catch (FileNotFoundException e) {
+ rootDoc
+ .printError("Cannot find tocFile: " + tocFile.getAbsolutePath()); //$NON-NLS-1$
+ }
+
+ }
+
+ // private static void printOptions(String options[][]) {
+ // System.out.println();
+ // System.out
+ // .println("************************* START Options
+ // ***************************"); //$NON-NLS-1$
+ // System.out.println();
+ // for (int i = 0; i < options.length; i++) {
+ // String[] opt = options[i];
+ // for (int j = 0; j < opt.length; j++) {
+ // String string = opt[j];
+ // System.out.print(string + " "); //$NON-NLS-1$
+ // }
+ // System.out.println();
+ // }
+ // System.out.println();
+ // System.out
+ // .println("************************* END Options
+ // ***************************"); //$NON-NLS-1$
+ // System.out.println();
+ // }
+
+} \ No newline at end of file
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/ITagDefinitions.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/ITagDefinitions.java
new file mode 100644
index 000000000..f0ed1fb32
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/ITagDefinitions.java
@@ -0,0 +1,22 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet;
+
+
+/**
+ * New tags supported by the Doclet
+ */
+public interface ITagDefinitions {
+ public static final String TAG_CAN_BE_SEEN_BY = "canBeSeenBy"; //$NON-NLS-1$
+ public static final String TAG_CAN_BE_IMPLEMENTED_BY = "canBeImplementedBy "; //$NON-NLS-1$
+ public static final String TAG_CAN_BE_SUBCLASSED_BY = "canBeSubclassedBy"; //$NON-NLS-1$
+ public static final String TAG_CAN_BE_INSTANTIATED_BY = "canBeInstantiatedBy"; //$NON-NLS-1$
+ public static final String TAG_CAN_BE_EXECUTED_BY = "canBeExecutedBy"; //$NON-NLS-1$
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ClassDocProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ClassDocProxy.java
new file mode 100644
index 000000000..707053623
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ClassDocProxy.java
@@ -0,0 +1,210 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.ConstructorDoc;
+import com.sun.javadoc.FieldDoc;
+import com.sun.javadoc.MethodDoc;
+import com.sun.javadoc.PackageDoc;
+import com.sun.javadoc.Type;
+
+
+/**
+ * Proxy to a ClassDoc
+ */
+public class ClassDocProxy
+ extends ProgramElementDocProxy
+ implements ClassDoc {
+
+ private Type type;
+
+ public ClassDocProxy(ClassDoc innerClassDoc) {
+ super (innerClassDoc);
+ type = new TypeProxy(innerClassDoc);
+ }
+
+ private ClassDoc getInnerClassDoc() {
+ return (ClassDoc)getInnerObject();
+ }
+
+ private Type getType() {
+ return type;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#definesSerializableFields()
+ */
+ public boolean definesSerializableFields() {
+ return getInnerClassDoc().definesSerializableFields();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#isAbstract()
+ */
+ public boolean isAbstract() {
+ return getInnerClassDoc().isAbstract();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#isExternalizable()
+ */
+ public boolean isExternalizable() {
+ return getInnerClassDoc().isExternalizable();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#isSerializable()
+ */
+ public boolean isSerializable() {
+ return getInnerClassDoc().isSerializable();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#superclass()
+ */
+ public ClassDoc superclass() {
+ return FACTORY.createClassDocProxy(getInnerClassDoc().superclass());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#importedClasses()
+ */
+ public ClassDoc[] importedClasses() {
+ return FACTORY.createClassDocProxies(getInnerClassDoc().importedClasses());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#innerClasses()
+ */
+ public ClassDoc[] innerClasses() {
+ return FACTORY.createClassDocProxies(getInnerClassDoc().innerClasses());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#interfaces()
+ */
+ public ClassDoc[] interfaces() {
+ return FACTORY.createClassDocProxies(getInnerClassDoc().interfaces());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#subclassOf(com.sun.javadoc.ClassDoc)
+ */
+ public boolean subclassOf(ClassDoc arg0) {
+ return getInnerClassDoc().subclassOf((ClassDoc)ProxyUtil.getInnerObject(arg0));
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#innerClasses(boolean)
+ */
+ public ClassDoc[] innerClasses(boolean arg0) {
+ return getInnerClassDoc().innerClasses(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#constructors()
+ */
+ public ConstructorDoc[] constructors() {
+ return FACTORY.createConstructorDocProxies(getInnerClassDoc().constructors());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#constructors(boolean)
+ */
+ public ConstructorDoc[] constructors(boolean arg0) {
+ return FACTORY.createConstructorDocProxies(getInnerClassDoc().constructors(arg0));
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#fields()
+ */
+ public FieldDoc[] fields() {
+ return FACTORY.createFieldDocProxies(getInnerClassDoc().fields());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#serializableFields()
+ */
+ public FieldDoc[] serializableFields() {
+ return FACTORY.createFieldDocProxies(getInnerClassDoc().serializableFields());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#fields(boolean)
+ */
+ public FieldDoc[] fields(boolean arg0) {
+ return FACTORY.createFieldDocProxies(getInnerClassDoc().fields(arg0));
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#methods()
+ */
+ public MethodDoc[] methods() {
+ return FACTORY.createMethodDocProxies(getInnerClassDoc().methods());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#serializationMethods()
+ */
+ public MethodDoc[] serializationMethods() {
+ return FACTORY.createMethodDocProxies(getInnerClassDoc().serializationMethods());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#methods(boolean)
+ */
+ public MethodDoc[] methods(boolean arg0) {
+ return FACTORY.createMethodDocProxies(getInnerClassDoc().methods(arg0));
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#importedPackages()
+ */
+ public PackageDoc[] importedPackages() {
+ return FACTORY.createPackageDocProxies(getInnerClassDoc().importedPackages());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ClassDoc#findClass(java.lang.String)
+ */
+ public ClassDoc findClass(String arg0) {
+ return FACTORY.createClassDocProxy(getInnerClassDoc().findClass(arg0));
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Type#asClassDoc()
+ */
+ public ClassDoc asClassDoc() {
+ return getType().asClassDoc();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Type#dimension()
+ */
+ public String dimension() {
+ return getType().dimension();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Type#qualifiedTypeName()
+ */
+ public String qualifiedTypeName() {
+ return getType().qualifiedTypeName();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Type#typeName()
+ */
+ public String typeName() {
+ return getType().typeName();
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ComparableProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ComparableProxy.java
new file mode 100644
index 000000000..ff4edb2a5
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ComparableProxy.java
@@ -0,0 +1,37 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+
+/**
+ * Proxy to a Comparable
+ */
+public class ComparableProxy extends Proxy
+ implements Comparable {
+
+ public ComparableProxy(Comparable innerComparable) {
+ super (innerComparable);
+ }
+
+ private Comparable getInnerComparable() {
+ return (Comparable)getInnerObject();
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ public int compareTo(Object o) {
+ if (o instanceof Proxy) {
+ o = ((Proxy)o).getInnerObject();
+ }
+ return getInnerComparable().compareTo(o);
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ConstructorDocProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ConstructorDocProxy.java
new file mode 100644
index 000000000..08217bb38
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ConstructorDocProxy.java
@@ -0,0 +1,37 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.ConstructorDoc;
+import com.sun.javadoc.ExecutableMemberDoc;
+
+
+/**
+ * Proxy to a ConstructorDoc
+ */
+public class ConstructorDocProxy
+ extends ExecutableMemberDocProxy
+ implements ConstructorDoc {
+
+ public ConstructorDocProxy(ExecutableMemberDoc innerConstructorDoc) {
+ super (innerConstructorDoc);
+ }
+
+ private ConstructorDoc getInnerConstructorDoc() {
+ return (ConstructorDoc)getInnerObject();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ProgramElementDoc#qualifiedName()
+ */
+ public String qualifiedName() {
+ return getInnerConstructorDoc().qualifiedName();
+ }
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/DocProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/DocProxy.java
new file mode 100644
index 000000000..9e6e90012
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/DocProxy.java
@@ -0,0 +1,192 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import org.eclipse.gmf.runtime.doclet.AuroraDoclet;
+import com.sun.javadoc.Doc;
+import com.sun.javadoc.PackageDoc;
+import com.sun.javadoc.ProgramElementDoc;
+import com.sun.javadoc.RootDoc;
+import com.sun.javadoc.SeeTag;
+import com.sun.javadoc.SourcePosition;
+import com.sun.javadoc.Tag;
+
+
+/**
+ * Proxy to a Doc
+ */
+public class DocProxy
+ extends ComparableProxy
+ implements Doc {
+
+ public DocProxy(Doc innerDoc) {
+ super (innerDoc);
+ }
+
+ private Doc getInnerDoc() {
+ return (Doc)getInnerObject();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#isClass()
+ */
+ public boolean isClass() {
+ return getInnerDoc().isClass();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#isConstructor()
+ */
+ public boolean isConstructor() {
+ return getInnerDoc().isConstructor();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#isError()
+ */
+ public boolean isError() {
+ return getInnerDoc().isError();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#isException()
+ */
+ public boolean isException() {
+ return getInnerDoc().isException();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#isField()
+ */
+ public boolean isField() {
+ return getInnerDoc().isField();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#isIncluded()
+ */
+ public boolean isIncluded() {
+
+ boolean isIncluded = getInnerDoc().isIncluded();
+
+ /* If included, extra filtering may be caused by @canBeSeenBy tags */
+ if (isIncluded) {
+ if (getInnerDoc() instanceof PackageDoc) {
+ PackageDoc packageDoc = (PackageDoc)getInnerDoc();
+ String qualifiedName = packageDoc.name();
+ if ( AuroraDoclet.getNamespaceChecker().isClientPreventedToSee(qualifiedName) ) {
+ isIncluded = false;
+ }
+ } else if (getInnerDoc() instanceof ProgramElementDoc) {
+ ProgramElementDoc programElementDoc = (ProgramElementDoc)getInnerDoc();
+ String qualifiedName = programElementDoc.qualifiedName();
+ if ( AuroraDoclet.getNamespaceChecker().isClientPreventedToSee(qualifiedName) ) {
+ isIncluded = false;
+ }
+ } else if (getInnerDoc() instanceof RootDoc) {
+ isIncluded = true;
+ }
+ }
+
+ return isIncluded;
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#isInterface()
+ */
+ public boolean isInterface() {
+ return getInnerDoc().isInterface();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#isMethod()
+ */
+ public boolean isMethod() {
+ return getInnerDoc().isMethod();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#isOrdinaryClass()
+ */
+ public boolean isOrdinaryClass() {
+ return getInnerDoc().isOrdinaryClass();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#seeTags()
+ */
+ public SeeTag[] seeTags() {
+ return getInnerDoc().seeTags();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#position()
+ */
+ public SourcePosition position() {
+ return getInnerDoc().position();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#firstSentenceTags()
+ */
+ public Tag[] firstSentenceTags() {
+ return getInnerDoc().firstSentenceTags();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#inlineTags()
+ */
+ public Tag[] inlineTags() {
+ return getInnerDoc().inlineTags();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#tags()
+ */
+ public Tag[] tags() {
+ return getInnerDoc().tags();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#commentText()
+ */
+ public String commentText() {
+ return getInnerDoc().commentText();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#getRawCommentText()
+ */
+ public String getRawCommentText() {
+ return getInnerDoc().getRawCommentText();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#name()
+ */
+ public String name() {
+ return getInnerDoc().name();
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#setRawCommentText(java.lang.String)
+ */
+ public void setRawCommentText(String arg0) {
+ getInnerDoc().setRawCommentText(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see Doc#tags(java.lang.String)
+ */
+ public Tag[] tags(String arg0) {
+ return getInnerDoc().tags(arg0);
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ExecutableMemberDocProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ExecutableMemberDocProxy.java
new file mode 100644
index 000000000..6051029b3
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ExecutableMemberDocProxy.java
@@ -0,0 +1,91 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.ExecutableMemberDoc;
+import com.sun.javadoc.ParamTag;
+import com.sun.javadoc.Parameter;
+import com.sun.javadoc.ThrowsTag;
+
+
+/**
+ * Proxy to an ExecutableMemberDoc
+ */
+
+public class ExecutableMemberDocProxy
+ extends MemberDocProxy
+ implements ExecutableMemberDoc {
+
+ public ExecutableMemberDocProxy(ExecutableMemberDoc innerExecutableMemberDoc) {
+ super (innerExecutableMemberDoc);
+ }
+
+ private ExecutableMemberDoc getInnerExecutableMemberDoc() {
+ return (ExecutableMemberDoc)getInnerObject();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ExecutableMemberDoc#isNative()
+ */
+ public boolean isNative() {
+ return getInnerExecutableMemberDoc().isNative();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ExecutableMemberDoc#isSynchronized()
+ */
+ public boolean isSynchronized() {
+ return getInnerExecutableMemberDoc().isSynchronized();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ExecutableMemberDoc#thrownExceptions()
+ */
+ public ClassDoc[] thrownExceptions() {
+ return FACTORY.createClassDocProxies(getInnerExecutableMemberDoc().thrownExceptions());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ExecutableMemberDoc#paramTags()
+ */
+ public ParamTag[] paramTags() {
+ return getInnerExecutableMemberDoc().paramTags();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ExecutableMemberDoc#parameters()
+ */
+ public Parameter[] parameters() {
+ return FACTORY.createParameterProxies(getInnerExecutableMemberDoc().parameters());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ExecutableMemberDoc#throwsTags()
+ */
+ public ThrowsTag[] throwsTags() {
+ return FACTORY.createThrowsTagProxies(getInnerExecutableMemberDoc().throwsTags());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ExecutableMemberDoc#flatSignature()
+ */
+ public String flatSignature() {
+ return getInnerExecutableMemberDoc().flatSignature();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ExecutableMemberDoc#signature()
+ */
+ public String signature() {
+ return getInnerExecutableMemberDoc().signature();
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/FieldDocProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/FieldDocProxy.java
new file mode 100644
index 000000000..48eb98e88
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/FieldDocProxy.java
@@ -0,0 +1,75 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.FieldDoc;
+import com.sun.javadoc.SerialFieldTag;
+import com.sun.javadoc.Type;
+
+
+/**
+ * Proxy to a FieldDoc
+ */
+
+public class FieldDocProxy
+ extends MemberDocProxy
+ implements FieldDoc {
+
+ public FieldDocProxy(FieldDoc innerFieldDoc) {
+ super (innerFieldDoc);
+ }
+
+ private FieldDoc getInnerFieldDoc() {
+ return (FieldDoc)getInnerObject();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.FieldDoc#isTransient()
+ */
+ public boolean isTransient() {
+ return getInnerFieldDoc().isTransient();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.FieldDoc#isVolatile()
+ */
+ public boolean isVolatile() {
+ return getInnerFieldDoc().isVolatile();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.FieldDoc#serialFieldTags()
+ */
+ public SerialFieldTag[] serialFieldTags() {
+ return FACTORY.createSerialFieldTagProxies(getInnerFieldDoc().serialFieldTags());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.FieldDoc#type()
+ */
+ public Type type() {
+ return (Type)FACTORY.createTypeProxy(getInnerFieldDoc().type());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.FieldDoc#constantValue()
+ */
+ public Object constantValue() {
+ return getInnerFieldDoc().constantValue();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.FieldDoc#constantValueExpression()
+ */
+ public String constantValueExpression() {
+ return getInnerFieldDoc().constantValueExpression();
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/MemberDocProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/MemberDocProxy.java
new file mode 100644
index 000000000..3c73ec617
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/MemberDocProxy.java
@@ -0,0 +1,38 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.MemberDoc;
+
+
+/**
+ * Proxy to a MemberDoc
+ */
+
+public class MemberDocProxy
+ extends ProgramElementDocProxy
+ implements MemberDoc {
+
+ public MemberDocProxy(MemberDoc innerMemberDoc) {
+ super (innerMemberDoc);
+ }
+
+ private MemberDoc getInnerMemberDoc() {
+ return (MemberDoc)getInnerObject();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.MemberDoc#isSynthetic()
+ */
+ public boolean isSynthetic() {
+ return getInnerMemberDoc().isSynthetic();
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/MethodDocProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/MethodDocProxy.java
new file mode 100644
index 000000000..bf7f519a8
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/MethodDocProxy.java
@@ -0,0 +1,61 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.MethodDoc;
+import com.sun.javadoc.Type;
+
+
+/**
+ * Proxy to a MethodDoc
+ */
+
+public class MethodDocProxy
+ extends ExecutableMemberDocProxy
+ implements MethodDoc {
+
+ public MethodDocProxy(MethodDoc innerMethodDoc) {
+ super (innerMethodDoc);
+ }
+
+ private MethodDoc getInnerMethodDoc() {
+ return (MethodDoc)getInnerObject();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.MethodDoc#isAbstract()
+ */
+ public boolean isAbstract() {
+ return getInnerMethodDoc().isAbstract();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.MethodDoc#overriddenClass()
+ */
+ public ClassDoc overriddenClass() {
+ return FACTORY.createClassDocProxy(getInnerMethodDoc().overriddenClass());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.MethodDoc#overriddenMethod()
+ */
+ public MethodDoc overriddenMethod() {
+ return FACTORY.createMethodDocProxy(getInnerMethodDoc().overriddenMethod());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.MethodDoc#returnType()
+ */
+ public Type returnType() {
+ return (Type)FACTORY.createTypeProxy(getInnerMethodDoc().returnType());
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/PackageDocProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/PackageDocProxy.java
new file mode 100644
index 000000000..8f2cfcdef
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/PackageDocProxy.java
@@ -0,0 +1,82 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.PackageDoc;
+
+
+/**
+ * Proxy to a PackageDoc
+ */
+
+public class PackageDocProxy
+ extends DocProxy
+ implements PackageDoc {
+
+ public PackageDocProxy(PackageDoc innerPackageDoc) {
+ super (innerPackageDoc);
+ }
+
+ private PackageDoc getInnerPackageDoc() {
+ return (PackageDoc)getInnerObject();
+ }
+
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.PackageDoc#allClasses()
+ */
+ public ClassDoc[] allClasses() {
+ return ProxyFactory.getInstance().createClassDocProxies(getInnerPackageDoc().allClasses());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.PackageDoc#errors()
+ */
+ public ClassDoc[] errors() {
+ return ProxyFactory.getInstance().createClassDocProxies(getInnerPackageDoc().errors());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.PackageDoc#exceptions()
+ */
+ public ClassDoc[] exceptions() {
+ return ProxyFactory.getInstance().createClassDocProxies(getInnerPackageDoc().exceptions());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.PackageDoc#interfaces()
+ */
+ public ClassDoc[] interfaces() {
+ return ProxyFactory.getInstance().createClassDocProxies(getInnerPackageDoc().interfaces());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.PackageDoc#ordinaryClasses()
+ */
+ public ClassDoc[] ordinaryClasses() {
+ return ProxyFactory.getInstance().createClassDocProxies(getInnerPackageDoc().ordinaryClasses());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.PackageDoc#allClasses(boolean)
+ */
+ public ClassDoc[] allClasses(boolean arg0) {
+ return ProxyFactory.getInstance().createClassDocProxies(getInnerPackageDoc().allClasses(arg0));
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.PackageDoc#findClass(java.lang.String)
+ */
+ public ClassDoc findClass(String arg0) {
+ return ProxyFactory.getInstance().createClassDocProxy(getInnerPackageDoc().findClass(arg0));
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ParamTagProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ParamTagProxy.java
new file mode 100644
index 000000000..3517c56fa
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ParamTagProxy.java
@@ -0,0 +1,45 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.ParamTag;
+
+
+/**
+ * Proxy to a ParamTag
+ */
+
+public class ParamTagProxy
+ extends TagProxy
+ implements ParamTag {
+
+ public ParamTagProxy(ParamTag innerParamTag) {
+ super (innerParamTag);
+ }
+
+ private ParamTag getInnerParamTag() {
+ return (ParamTag)getInnerObject();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ParamTag#parameterComment()
+ */
+ public String parameterComment() {
+ return getInnerParamTag().parameterComment();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ParamTag#parameterName()
+ */
+ public String parameterName() {
+ return getInnerParamTag().parameterName();
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ParameterProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ParameterProxy.java
new file mode 100644
index 000000000..8c8f4f962
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ParameterProxy.java
@@ -0,0 +1,53 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.Parameter;
+import com.sun.javadoc.Type;
+
+
+/**
+ * Proxy to a Parameter
+ */
+
+public class ParameterProxy
+ extends Proxy
+ implements Parameter {
+
+ public ParameterProxy(Parameter innerParameter) {
+ super (innerParameter);
+ }
+
+ private Parameter getInnerParameter() {
+ return (Parameter)getInnerObject();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Parameter#type()
+ */
+ public Type type() {
+ return (Type)FACTORY.createTypeProxy(getInnerParameter().type());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Parameter#name()
+ */
+ public String name() {
+ return getInnerParameter().name();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Parameter#typeName()
+ */
+ public String typeName() {
+ return getInnerParameter().typeName();
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProgramElementDocProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProgramElementDocProxy.java
new file mode 100644
index 000000000..d3da80fed
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProgramElementDocProxy.java
@@ -0,0 +1,110 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.PackageDoc;
+import com.sun.javadoc.ProgramElementDoc;
+
+
+/**
+ * Proxy to a ProgramElementDoc
+ */
+
+public class ProgramElementDocProxy
+ extends DocProxy
+ implements ProgramElementDoc {
+
+ public ProgramElementDocProxy(ProgramElementDoc innerProgramElementDoc) {
+ super (innerProgramElementDoc);
+ }
+
+ private ProgramElementDoc getInnerProgramElementDoc() {
+ return (ProgramElementDoc)getInnerObject();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ProgramElementDoc#modifierSpecifier()
+ */
+ public int modifierSpecifier() {
+ return getInnerProgramElementDoc().modifierSpecifier();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ProgramElementDoc#isFinal()
+ */
+ public boolean isFinal() {
+ return getInnerProgramElementDoc().isFinal();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ProgramElementDoc#isPackagePrivate()
+ */
+ public boolean isPackagePrivate() {
+ return getInnerProgramElementDoc().isPackagePrivate();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ProgramElementDoc#isPrivate()
+ */
+ public boolean isPrivate() {
+ return getInnerProgramElementDoc().isPrivate();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ProgramElementDoc#isProtected()
+ */
+ public boolean isProtected() {
+ return getInnerProgramElementDoc().isProtected();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ProgramElementDoc#isPublic()
+ */
+ public boolean isPublic() {
+ return getInnerProgramElementDoc().isPublic();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ProgramElementDoc#isStatic()
+ */
+ public boolean isStatic() {
+ return getInnerProgramElementDoc().isStatic();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ProgramElementDoc#containingClass()
+ */
+ public ClassDoc containingClass() {
+ return FACTORY.createClassDocProxy(getInnerProgramElementDoc().containingClass());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ProgramElementDoc#containingPackage()
+ */
+ public PackageDoc containingPackage() {
+ return FACTORY.createPackageDocProxy(getInnerProgramElementDoc().containingPackage());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ProgramElementDoc#modifiers()
+ */
+ public String modifiers() {
+ return getInnerProgramElementDoc().modifiers();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ProgramElementDoc#qualifiedName()
+ */
+ public String qualifiedName() {
+ return getInnerProgramElementDoc().qualifiedName();
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/Proxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/Proxy.java
new file mode 100644
index 000000000..e8f920f11
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/Proxy.java
@@ -0,0 +1,33 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+
+
+/**
+ * Base proxy class. Used to wrap an Standard Doclet object. Derived classes
+ * forward calls to the wrapped instance and wrap generally the returned object.
+ */
+
+public class Proxy {
+
+ protected Object innerObject;
+
+ protected static ProxyFactory FACTORY = ProxyFactory.getInstance();
+
+ public Proxy(Object innerObject) {
+ this.innerObject = innerObject;
+ }
+
+ /*package*/ Object getInnerObject() {
+ return this.innerObject;
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProxyFactory.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProxyFactory.java
new file mode 100644
index 000000000..578f93b71
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProxyFactory.java
@@ -0,0 +1,909 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import java.util.ArrayList;
+
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.ConstructorDoc;
+import com.sun.javadoc.Doc;
+import com.sun.javadoc.ExecutableMemberDoc;
+import com.sun.javadoc.FieldDoc;
+import com.sun.javadoc.MemberDoc;
+import com.sun.javadoc.MethodDoc;
+import com.sun.javadoc.PackageDoc;
+import com.sun.javadoc.ParamTag;
+import com.sun.javadoc.Parameter;
+import com.sun.javadoc.ProgramElementDoc;
+import com.sun.javadoc.RootDoc;
+import com.sun.javadoc.SeeTag;
+import com.sun.javadoc.SerialFieldTag;
+import com.sun.javadoc.Tag;
+import com.sun.javadoc.ThrowsTag;
+import com.sun.javadoc.Type;
+
+/**
+ * Factory for proxy objects. Generate proxies for Object, typed Object, or collection.
+ * The factory is smart enough to always return the most derived proxy for a given element.
+ * The factory will always return the same proxy for a given object to wrap.
+ */
+
+public class ProxyFactory {
+
+ private ProxyRegistry proxyRegistry = null;
+
+ private static ProxyFactory instance = null;
+
+ public static ProxyFactory getInstance() {
+ if (instance == null) {
+ instance = new ProxyFactory();
+ }
+
+ return instance;
+ }
+
+ /*
+ * DocProxy Proxies
+ */
+
+ public DocProxy[] createDocProxies(Doc docs[]) {
+
+ ArrayList docProxies = new ArrayList();
+
+ for (int i = 0; i < docs.length; i++) {
+ Doc doc = docs[i];
+ docProxies.add(createDocProxy(doc));
+ }
+
+ return (DocProxy[]) docProxies.toArray(new DocProxy[0]);
+ }
+
+ public DocProxy createDocProxy(Object object) {
+ DocProxy docProxy = null;
+
+ if (object instanceof DocProxy) {
+ docProxy = (DocProxy) object;
+ } else {
+ if (object instanceof Doc) {
+ docProxy = createDocProxy((Doc) object);
+ }
+ }
+
+ return docProxy;
+ }
+
+ public DocProxy createDocProxy(Doc doc) {
+
+ DocProxy proxy = null;
+
+ if (doc != null) {
+ proxy = (DocProxy) getProxyRegistry().getProxyForObject(doc);
+ if (proxy == null) {
+ if (doc instanceof PackageDoc) {
+ proxy = createPackageDocProxy((PackageDoc) doc);
+ } else if (doc instanceof ProgramElementDoc) {
+ proxy = createProgramElementDocProxy((ProgramElementDoc) doc);
+ } else if (doc instanceof RootDoc) {
+ proxy = createRootDocProxy((RootDoc) doc);
+ } else {
+ proxy = new DocProxy(doc);
+ ProxyFactory.getInstance().getProxyRegistry()
+ .registerProxy(doc, proxy);
+ }
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * PackageDoc Proxies
+ */
+
+ public PackageDocProxy[] createPackageDocProxies(PackageDoc packageDocs[]) {
+
+ ArrayList packageDocProxies = new ArrayList();
+
+ for (int i = 0; i < packageDocs.length; i++) {
+ PackageDoc packageDoc = packageDocs[i];
+ packageDocProxies.add(createPackageDocProxy(packageDoc));
+ }
+
+ return (PackageDocProxy[]) packageDocProxies
+ .toArray(new PackageDocProxy[0]);
+ }
+
+ public PackageDocProxy createPackageDocProxy(Object object) {
+ PackageDocProxy packageDocProxy = null;
+
+ if (object instanceof PackageDocProxy) {
+ packageDocProxy = (PackageDocProxy) object;
+ } else {
+ if (object instanceof PackageDoc) {
+ packageDocProxy = createPackageDocProxy((PackageDoc) object);
+ }
+ }
+
+ return packageDocProxy;
+ }
+
+ public PackageDocProxy createPackageDocProxy(PackageDoc packageDoc) {
+
+ PackageDocProxy proxy = null;
+
+ if (packageDoc != null) {
+ proxy = (PackageDocProxy) getProxyRegistry().getProxyForObject(
+ packageDoc);
+ if (proxy == null) {
+ proxy = new PackageDocProxy(packageDoc);
+ ProxyFactory.getInstance().getProxyRegistry().registerProxy(
+ packageDoc, proxy);
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * ProgramElementDocProxy Proxies
+ */
+
+ public ProgramElementDocProxy[] createProgramElementDocProxies(
+ ProgramElementDoc programElementDocs[]) {
+
+ ArrayList programElementDocProxies = new ArrayList();
+
+ for (int i = 0; i < programElementDocs.length; i++) {
+ ProgramElementDoc programElementDoc = programElementDocs[i];
+ programElementDocProxies
+ .add(createProgramElementDocProxy(programElementDoc));
+ }
+
+ return (ProgramElementDocProxy[]) programElementDocProxies
+ .toArray(new ProgramElementDocProxy[0]);
+ }
+
+ public ProgramElementDocProxy createProgramElementDocProxy(Object object) {
+ ProgramElementDocProxy programElementDocProxy = null;
+
+ if (object instanceof ProgramElementDocProxy) {
+ programElementDocProxy = (ProgramElementDocProxy) object;
+ } else {
+ if (object instanceof ProgramElementDoc) {
+ programElementDocProxy = createProgramElementDocProxy((ProgramElementDoc) object);
+ }
+ }
+
+ return programElementDocProxy;
+ }
+
+ public ProgramElementDocProxy createProgramElementDocProxy(
+ ProgramElementDoc programElementDoc) {
+
+ ProgramElementDocProxy proxy = null;
+
+ if (programElementDoc != null) {
+ proxy = (ProgramElementDocProxy) getProxyRegistry()
+ .getProxyForObject(programElementDoc);
+ if (proxy == null) {
+ if (programElementDoc instanceof ClassDoc) {
+ proxy = createClassDocProxy((ClassDoc) programElementDoc);
+ } else if (programElementDoc instanceof MemberDoc) {
+ proxy = createMemberDocProxy((MemberDoc) programElementDoc);
+ } else {
+ proxy = new ProgramElementDocProxy(programElementDoc);
+ ProxyFactory.getInstance().getProxyRegistry()
+ .registerProxy(programElementDoc, proxy);
+ }
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * RootDoc Proxies
+ */
+
+ public RootDocProxy createRootDocProxy(Object object) {
+ RootDocProxy rootDocProxy = null;
+
+ if (object instanceof RootDocProxy) {
+ rootDocProxy = (RootDocProxy) object;
+ } else {
+ if (object instanceof RootDoc) {
+ rootDocProxy = createRootDocProxy((RootDoc) object);
+ }
+ }
+
+ return rootDocProxy;
+ }
+
+ public RootDocProxy createRootDocProxy(RootDoc rootDoc) {
+
+ RootDocProxy proxy = null;
+
+ if (rootDoc != null) {
+ proxy = (RootDocProxy) getProxyRegistry()
+ .getProxyForObject(rootDoc);
+ if (proxy == null) {
+ proxy = new RootDocProxy(rootDoc);
+ ProxyFactory.getInstance().getProxyRegistry().registerProxy(
+ rootDoc, proxy);
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * ClassDoc Proxies
+ */
+
+ public ClassDocProxy[] createClassDocProxies(ClassDoc classDocs[]) {
+
+ ArrayList classDocProxies = new ArrayList();
+
+ for (int i = 0; i < classDocs.length; i++) {
+ ClassDoc classDoc = classDocs[i];
+ classDocProxies.add(createClassDocProxy(classDoc));
+ }
+
+ return (ClassDocProxy[]) classDocProxies.toArray(new ClassDocProxy[0]);
+ }
+
+ public ClassDocProxy createClassDocProxy(Object object) {
+ ClassDocProxy classDocProxy = null;
+
+ if (object instanceof ClassDocProxy) {
+ classDocProxy = (ClassDocProxy) object;
+ } else {
+ if (object instanceof ClassDoc) {
+ classDocProxy = createClassDocProxy((ClassDoc) object);
+ }
+ }
+
+ return classDocProxy;
+ }
+
+ public ClassDocProxy createClassDocProxy(ClassDoc classDoc) {
+
+ ClassDocProxy proxy = null;
+
+ if (classDoc != null) {
+ proxy = (ClassDocProxy) getProxyRegistry().getProxyForObject(
+ classDoc);
+ if (proxy == null) {
+ proxy = new ClassDocProxy(classDoc);
+ ProxyFactory.getInstance().getProxyRegistry().registerProxy(
+ classDoc, proxy);
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * MemberDoc Proxies
+ */
+
+ public MemberDocProxy[] createMemberDocProxies(MemberDoc memberDocs[]) {
+
+ ArrayList memberDocProxies = new ArrayList();
+
+ for (int i = 0; i < memberDocs.length; i++) {
+ MemberDoc memberDoc = memberDocs[i];
+ memberDocProxies.add(createMemberDocProxy(memberDoc));
+ }
+
+ return (MemberDocProxy[]) memberDocProxies
+ .toArray(new MemberDocProxy[0]);
+ }
+
+ public MemberDocProxy createMemberDocProxy(Object object) {
+ MemberDocProxy memberDocProxy = null;
+
+ if (object instanceof MemberDocProxy) {
+ memberDocProxy = (MemberDocProxy) object;
+ } else {
+ if (object instanceof MemberDoc) {
+ memberDocProxy = createMemberDocProxy((MemberDoc) object);
+ }
+ }
+
+ return memberDocProxy;
+ }
+
+ public MemberDocProxy createMemberDocProxy(MemberDoc memberDoc) {
+
+ MemberDocProxy proxy = null;
+
+ if (memberDoc != null) {
+ proxy = (MemberDocProxy) getProxyRegistry().getProxyForObject(
+ memberDoc);
+ if (proxy == null) {
+ if (memberDoc instanceof ExecutableMemberDoc) {
+ proxy = createExecutableMemberDocProxy((ExecutableMemberDoc) memberDoc);
+ } else if (memberDoc instanceof FieldDoc) {
+ proxy = createFieldDocProxy((FieldDoc) memberDoc);
+ } else {
+ proxy = new MemberDocProxy(memberDoc);
+ ProxyFactory.getInstance().getProxyRegistry()
+ .registerProxy(memberDoc, proxy);
+ }
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * ExecutableMemberDoc Proxies
+ */
+
+ public ExecutableMemberDocProxy[] createExecutableMemberDocProxies(
+ ExecutableMemberDoc executableMemberDocs[]) {
+
+ ArrayList executableMemberDocProxies = new ArrayList();
+
+ for (int i = 0; i < executableMemberDocs.length; i++) {
+ ExecutableMemberDoc executableMemberDoc = executableMemberDocs[i];
+ executableMemberDocProxies
+ .add(createExecutableMemberDocProxy(executableMemberDoc));
+ }
+
+ return (ExecutableMemberDocProxy[]) executableMemberDocProxies
+ .toArray(new ExecutableMemberDocProxy[0]);
+ }
+
+ public ExecutableMemberDocProxy createExecutableMemberDocProxy(Object object) {
+ ExecutableMemberDocProxy executableMemberDocProxy = null;
+
+ if (object instanceof ExecutableMemberDocProxy) {
+ executableMemberDocProxy = (ExecutableMemberDocProxy) object;
+ } else {
+ if (object instanceof ExecutableMemberDoc) {
+ executableMemberDocProxy = createExecutableMemberDocProxy((ExecutableMemberDoc) object);
+ }
+ }
+
+ return executableMemberDocProxy;
+ }
+
+ public ExecutableMemberDocProxy createExecutableMemberDocProxy(
+ ExecutableMemberDoc executableMemberDoc) {
+
+ ExecutableMemberDocProxy proxy = null;
+
+ if (executableMemberDoc != null) {
+ proxy = (ExecutableMemberDocProxy) getProxyRegistry()
+ .getProxyForObject(executableMemberDoc);
+ if (proxy == null) {
+ if (executableMemberDoc instanceof ConstructorDoc) {
+ proxy = createConstructorDocProxy((ConstructorDoc) executableMemberDoc);
+ } else if (executableMemberDoc instanceof MethodDoc) {
+ proxy = createMethodDocProxy((MethodDoc) executableMemberDoc);
+ } else {
+ proxy = new ExecutableMemberDocProxy(executableMemberDoc);
+ ProxyFactory.getInstance().getProxyRegistry()
+ .registerProxy(executableMemberDoc, proxy);
+ }
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * FieldDoc Proxies
+ */
+
+ public FieldDocProxy[] createFieldDocProxies(FieldDoc fieldDocs[]) {
+
+ ArrayList fieldDocProxies = new ArrayList();
+
+ for (int i = 0; i < fieldDocs.length; i++) {
+ FieldDoc fieldDoc = fieldDocs[i];
+ fieldDocProxies.add(createFieldDocProxy(fieldDoc));
+ }
+
+ return (FieldDocProxy[]) fieldDocProxies.toArray(new FieldDocProxy[0]);
+ }
+
+ public FieldDocProxy createFieldDocProxy(Object object) {
+ FieldDocProxy fieldDocProxy = null;
+
+ if (object instanceof FieldDocProxy) {
+ fieldDocProxy = (FieldDocProxy) object;
+ } else {
+ if (object instanceof FieldDoc) {
+ fieldDocProxy = createFieldDocProxy((FieldDoc) object);
+ }
+ }
+
+ return fieldDocProxy;
+ }
+
+ public FieldDocProxy createFieldDocProxy(FieldDoc fieldDoc) {
+
+ FieldDocProxy proxy = null;
+
+ if (fieldDoc != null) {
+ proxy = (FieldDocProxy) getProxyRegistry().getProxyForObject(
+ fieldDoc);
+ if (proxy == null) {
+ proxy = new FieldDocProxy(fieldDoc);
+ ProxyFactory.getInstance().getProxyRegistry().registerProxy(
+ fieldDoc, proxy);
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * ContructorDoc Proxies
+ */
+
+ public ConstructorDocProxy[] createConstructorDocProxies(
+ ConstructorDoc constructorDocs[]) {
+
+ ArrayList constructorDocProxies = new ArrayList();
+
+ for (int i = 0; i < constructorDocs.length; i++) {
+ ConstructorDoc constructorDoc = constructorDocs[i];
+ constructorDocProxies
+ .add(createConstructorDocProxy(constructorDoc));
+ }
+
+ return (ConstructorDocProxy[]) constructorDocProxies
+ .toArray(new ConstructorDocProxy[0]);
+ }
+
+ public ConstructorDocProxy createConstructorDocProxy(Object object) {
+ ConstructorDocProxy constructorDocProxy = null;
+
+ if (object instanceof ConstructorDocProxy) {
+ constructorDocProxy = (ConstructorDocProxy) object;
+ } else {
+ if (object instanceof ConstructorDoc) {
+ constructorDocProxy = createConstructorDocProxy((ConstructorDoc) object);
+ }
+ }
+
+ return constructorDocProxy;
+ }
+
+ public ConstructorDocProxy createConstructorDocProxy(
+ ConstructorDoc constructorDoc) {
+
+ ConstructorDocProxy proxy = null;
+
+ if (constructorDoc != null) {
+ proxy = (ConstructorDocProxy) getProxyRegistry().getProxyForObject(
+ constructorDoc);
+ if (proxy == null) {
+ proxy = new ConstructorDocProxy(constructorDoc);
+ ProxyFactory.getInstance().getProxyRegistry().registerProxy(
+ constructorDoc, proxy);
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * MethodDoc Proxies
+ */
+
+ public MethodDocProxy[] createMethodDocProxies(MethodDoc methodDocs[]) {
+
+ ArrayList methodDocProxies = new ArrayList();
+
+ for (int i = 0; i < methodDocs.length; i++) {
+ MethodDoc methodDoc = methodDocs[i];
+ methodDocProxies.add(createMethodDocProxy(methodDoc));
+ }
+
+ return (MethodDocProxy[]) methodDocProxies
+ .toArray(new MethodDocProxy[0]);
+ }
+
+ public MethodDocProxy createMethodDocProxy(Object object) {
+ MethodDocProxy methodDocProxy = null;
+
+ if (object instanceof MethodDocProxy) {
+ methodDocProxy = (MethodDocProxy) object;
+ } else {
+ if (object instanceof MethodDoc) {
+ methodDocProxy = createMethodDocProxy((MethodDoc) object);
+ }
+ }
+
+ return methodDocProxy;
+ }
+
+ public MethodDocProxy createMethodDocProxy(MethodDoc methodDoc) {
+
+ MethodDocProxy proxy = null;
+
+ if (methodDoc != null) {
+ proxy = (MethodDocProxy) getProxyRegistry().getProxyForObject(
+ methodDoc);
+ if (proxy == null) {
+ proxy = new MethodDocProxy(methodDoc);
+ ProxyFactory.getInstance().getProxyRegistry().registerProxy(
+ methodDoc, proxy);
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * Parameter Proxies
+ */
+
+ public ParameterProxy[] createParameterProxies(Parameter parameters[]) {
+
+ ArrayList parameterProxies = new ArrayList();
+
+ for (int i = 0; i < parameters.length; i++) {
+ Parameter parameter = parameters[i];
+ parameterProxies.add(createParameterProxy(parameter));
+ }
+
+ return (ParameterProxy[]) parameterProxies
+ .toArray(new ParameterProxy[0]);
+ }
+
+ public ParameterProxy createParameterProxy(Object object) {
+ ParameterProxy parameterProxy = null;
+
+ if (object instanceof ParameterProxy) {
+ parameterProxy = (ParameterProxy) object;
+ } else {
+ if (object instanceof Parameter) {
+ parameterProxy = createParameterProxy((Parameter) object);
+ }
+ }
+
+ return parameterProxy;
+ }
+
+ public ParameterProxy createParameterProxy(Parameter parameter) {
+
+ ParameterProxy proxy = null;
+
+ if (parameter != null) {
+ proxy = (ParameterProxy) getProxyRegistry().getProxyForObject(
+ parameter);
+ if (proxy == null) {
+ proxy = new ParameterProxy(parameter);
+ ProxyFactory.getInstance().getProxyRegistry().registerProxy(
+ parameter, proxy);
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * Type Proxies
+ */
+
+ public Proxy[] createTypeProxies(Type types[]) {
+
+ ArrayList typeProxies = new ArrayList();
+
+ for (int i = 0; i < types.length; i++) {
+ Type type = types[i];
+ typeProxies.add(createTypeProxy(type));
+ }
+
+ return (Proxy[]) typeProxies.toArray(new Proxy[0]);
+ }
+
+ public Proxy createTypeProxy(Object object) {
+ Proxy typeProxy = null;
+
+ if (object instanceof TypeProxy) {
+ typeProxy = (TypeProxy) object;
+ } else {
+ if (object instanceof Type) {
+ typeProxy = createTypeProxy((Type) object);
+ }
+ }
+
+ return typeProxy;
+ }
+
+ public Proxy createTypeProxy(Type type) {
+
+ Proxy proxy = null;
+
+ if (type != null) {
+ proxy = getProxyRegistry().getProxyForObject(type);
+ if (proxy == null) {
+ if (type instanceof ClassDoc) {
+ proxy = new ClassDocProxy((ClassDoc) type);
+ } else {
+ proxy = new TypeProxy(type);
+ }
+ ProxyFactory.getInstance().getProxyRegistry().registerProxy(
+ type, proxy);
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * Tag Proxies
+ */
+
+ public TagProxy[] createTagProxies(Tag tags[]) {
+
+ ArrayList tagProxies = new ArrayList();
+
+ for (int i = 0; i < tags.length; i++) {
+ Tag tag = tags[i];
+ tagProxies.add(createTagProxy(tag));
+ }
+
+ return (TagProxy[]) tagProxies.toArray(new TagProxy[0]);
+ }
+
+ public TagProxy createTagProxy(Object object) {
+ TagProxy tagProxy = null;
+
+ if (object instanceof TagProxy) {
+ tagProxy = (TagProxy) object;
+ } else {
+ if (object instanceof Tag) {
+ tagProxy = createTagProxy((Tag) object);
+ }
+ }
+
+ return tagProxy;
+ }
+
+ public TagProxy createTagProxy(Tag tag) {
+
+ TagProxy proxy = null;
+
+ if (tag != null) {
+ proxy = (TagProxy) getProxyRegistry().getProxyForObject(tag);
+ if (proxy == null) {
+ if (tag instanceof ParamTag) {
+ proxy = createParamTagProxy((ParamTag) tag);
+ } else if (tag instanceof SeeTag) {
+ proxy = createSeeTagProxy((SeeTag) tag);
+ } else if (tag instanceof SerialFieldTag) {
+ proxy = createSerialFieldTagProxy((SerialFieldTag) tag);
+ } else if (tag instanceof ThrowsTag) {
+ proxy = createThrowsTagProxy((ThrowsTag) tag);
+ } else {
+ proxy = new TagProxy(tag);
+ }
+
+ ProxyFactory.getInstance().getProxyRegistry().registerProxy(
+ tag, proxy);
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * ParamTag Proxies
+ */
+
+ public ParamTagProxy[] createParamTagProxies(ParamTag paramTags[]) {
+
+ ArrayList paramTagProxies = new ArrayList();
+
+ for (int i = 0; i < paramTags.length; i++) {
+ ParamTag paramTag = paramTags[i];
+ paramTagProxies.add(createParamTagProxy(paramTag));
+ }
+
+ return (ParamTagProxy[]) paramTagProxies
+ .toArray(new ParamTagProxy[0]);
+ }
+
+ public ParamTagProxy createParamTagProxy(Object object) {
+ ParamTagProxy paramTagProxy = null;
+
+ if (object instanceof ParamTagProxy) {
+ paramTagProxy = (ParamTagProxy) object;
+ } else {
+ if (object instanceof ParamTag) {
+ paramTagProxy = createParamTagProxy((ParamTag) object);
+ }
+ }
+
+ return paramTagProxy;
+ }
+
+ public ParamTagProxy createParamTagProxy(ParamTag paramTag) {
+
+ ParamTagProxy proxy = null;
+
+ if (paramTag != null) {
+ proxy = (ParamTagProxy) getProxyRegistry().getProxyForObject(
+ paramTag);
+ if (proxy == null) {
+ proxy = new ParamTagProxy(paramTag);
+ ProxyFactory.getInstance().getProxyRegistry().registerProxy(
+ paramTag, proxy);
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * SeeTag Proxies
+ */
+
+ public SeeTagProxy[] createSeeTagProxies(SeeTag seeTags[]) {
+
+ ArrayList seeTagProxies = new ArrayList();
+
+ for (int i = 0; i < seeTags.length; i++) {
+ SeeTag seeTag = seeTags[i];
+ seeTagProxies.add(createSeeTagProxy(seeTag));
+ }
+
+ return (SeeTagProxy[]) seeTagProxies
+ .toArray(new SeeTagProxy[0]);
+ }
+
+ public SeeTagProxy createSeeTagProxy(Object object) {
+ SeeTagProxy seeTagProxy = null;
+
+ if (object instanceof SeeTagProxy) {
+ seeTagProxy = (SeeTagProxy) object;
+ } else {
+ if (object instanceof SeeTag) {
+ seeTagProxy = createSeeTagProxy((SeeTag) object);
+ }
+ }
+
+ return seeTagProxy;
+ }
+
+ public SeeTagProxy createSeeTagProxy(SeeTag seeTag) {
+
+ SeeTagProxy proxy = null;
+
+ if (seeTag != null) {
+ proxy = (SeeTagProxy) getProxyRegistry().getProxyForObject(
+ seeTag);
+ if (proxy == null) {
+ proxy = new SeeTagProxy(seeTag);
+ ProxyFactory.getInstance().getProxyRegistry().registerProxy(
+ seeTag, proxy);
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * ThrowsTag Proxies
+ */
+
+ public ThrowsTagProxy[] createThrowsTagProxies(ThrowsTag throwsTags[]) {
+
+ ArrayList throwsTagProxies = new ArrayList();
+
+ for (int i = 0; i < throwsTags.length; i++) {
+ ThrowsTag throwsTag = throwsTags[i];
+ throwsTagProxies.add(createThrowsTagProxy(throwsTag));
+ }
+
+ return (ThrowsTagProxy[]) throwsTagProxies
+ .toArray(new ThrowsTagProxy[0]);
+ }
+
+ public ThrowsTagProxy createThrowsTagProxy(Object object) {
+ ThrowsTagProxy throwsTagProxy = null;
+
+ if (object instanceof ThrowsTagProxy) {
+ throwsTagProxy = (ThrowsTagProxy) object;
+ } else {
+ if (object instanceof ThrowsTag) {
+ throwsTagProxy = createThrowsTagProxy((ThrowsTag) object);
+ }
+ }
+
+ return throwsTagProxy;
+ }
+
+ public ThrowsTagProxy createThrowsTagProxy(ThrowsTag throwsTag) {
+
+ ThrowsTagProxy proxy = null;
+
+ if (throwsTag != null) {
+ proxy = (ThrowsTagProxy) getProxyRegistry().getProxyForObject(
+ throwsTag);
+ if (proxy == null) {
+ proxy = new ThrowsTagProxy(throwsTag);
+ ProxyFactory.getInstance().getProxyRegistry().registerProxy(
+ throwsTag, proxy);
+ }
+ }
+
+ return proxy;
+ }
+
+ /*
+ * SerialFieldTag Proxies
+ */
+
+ public SerialFieldTagProxy[] createSerialFieldTagProxies(
+ SerialFieldTag serialFieldTags[]) {
+
+ ArrayList serialFieldTagProxies = new ArrayList();
+
+ for (int i = 0; i < serialFieldTags.length; i++) {
+ SerialFieldTag serialFieldTag = serialFieldTags[i];
+ serialFieldTagProxies
+ .add(createSerialFieldTagProxy(serialFieldTag));
+ }
+
+ return (SerialFieldTagProxy[]) serialFieldTagProxies
+ .toArray(new SerialFieldTagProxy[0]);
+ }
+
+ public SerialFieldTagProxy createSerialFieldTagProxy(Object object) {
+ SerialFieldTagProxy serialFieldTagProxy = null;
+
+ if (object instanceof SerialFieldTagProxy) {
+ serialFieldTagProxy = (SerialFieldTagProxy) object;
+ } else {
+ if (object instanceof SerialFieldTag) {
+ serialFieldTagProxy = createSerialFieldTagProxy((SerialFieldTag) object);
+ }
+ }
+
+ return serialFieldTagProxy;
+ }
+
+ public SerialFieldTagProxy createSerialFieldTagProxy(
+ SerialFieldTag serialFieldTag) {
+
+ SerialFieldTagProxy proxy = null;
+
+ if (serialFieldTag != null) {
+ proxy = (SerialFieldTagProxy) getProxyRegistry().getProxyForObject(
+ serialFieldTag);
+ if (proxy == null) {
+ proxy = new SerialFieldTagProxy(serialFieldTag);
+ ProxyFactory.getInstance().getProxyRegistry().registerProxy(
+ serialFieldTag, proxy);
+ }
+ }
+
+ return proxy;
+ }
+
+
+
+ private ProxyFactory() {
+ proxyRegistry = new ProxyRegistry();
+ }
+
+ /* package */ProxyRegistry getProxyRegistry() {
+ return proxyRegistry;
+ }
+} \ No newline at end of file
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProxyRegistry.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProxyRegistry.java
new file mode 100644
index 000000000..49a51a428
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProxyRegistry.java
@@ -0,0 +1,34 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import java.util.HashMap;
+
+
+/**
+ * Registry of proxies.
+ */
+public class ProxyRegistry {
+
+ private HashMap objectToProxyMap;
+
+ public ProxyRegistry() {
+ this.objectToProxyMap = new HashMap();
+ }
+
+ public void registerProxy(Object object, Proxy proxy) {
+ this.objectToProxyMap.put(object, proxy);
+ }
+
+ public Proxy getProxyForObject(Object object) {
+ return (Proxy)this.objectToProxyMap.get(object);
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProxyUtil.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProxyUtil.java
new file mode 100644
index 000000000..daf8bda95
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ProxyUtil.java
@@ -0,0 +1,25 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+
+
+/**
+ * Utility to deal with proxies
+ */
+public class ProxyUtil {
+
+ public static Object getInnerObject(Object possibleProxy) {
+ if (possibleProxy instanceof Proxy) {
+ possibleProxy = ((Proxy)possibleProxy).getInnerObject();
+ }
+ return possibleProxy;
+ }
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/RootDocProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/RootDocProxy.java
new file mode 100644
index 000000000..a443ee3e8
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/RootDocProxy.java
@@ -0,0 +1,248 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import java.util.ArrayList;
+
+import org.eclipse.gmf.runtime.doclet.AuroraDoclet;
+import org.eclipse.gmf.runtime.doclet.ITagDefinitions;
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.PackageDoc;
+import com.sun.javadoc.RootDoc;
+import com.sun.javadoc.SourcePosition;
+
+/**
+ * Proxy to a RootDoc. Manages the filtering of classes and packages.
+ */
+
+public class RootDocProxy
+ extends DocProxy
+ implements RootDoc {
+
+ private ClassDoc[] filteredClasses = null;
+
+ private ClassDoc[] filteredSpecifiedClasses = null;
+
+ private PackageDoc[] filteredSpecifiedPackages = null;
+
+ private String options[][] = null;
+
+ public RootDocProxy(RootDoc innerRootDoc) {
+ super(innerRootDoc);
+ setFilteredClasses(filterClasses(getInnerRootDoc().classes()));
+ setFilteredSpecifiedClasses(filterClasses(getInnerRootDoc()
+ .specifiedClasses()));
+ setFilteredPackages(filterPackages(getInnerRootDoc()
+ .specifiedPackages()));
+ }
+
+ private RootDoc getInnerRootDoc() {
+ return (RootDoc) getInnerObject();
+ }
+
+ private ClassDoc[] getFilteredClasses() {
+ return this.filteredClasses;
+ }
+
+ private void setFilteredClasses(ClassDoc[] filteredClasses) {
+ this.filteredClasses = filteredClasses;
+ }
+
+ private ClassDoc[] getFilteredSpecifiedClasses() {
+ return this.filteredSpecifiedClasses;
+ }
+
+ private void setFilteredSpecifiedClasses(ClassDoc[] filteredSpecifiedClasses) {
+ this.filteredSpecifiedClasses = filteredSpecifiedClasses;
+ }
+
+ private PackageDoc[] getFilteredSpecifiedPackages() {
+ return this.filteredSpecifiedPackages;
+ }
+
+ private void setFilteredPackages(PackageDoc[] filteredSpecifiedPackages) {
+ this.filteredSpecifiedPackages = filteredSpecifiedPackages;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.javadoc.RootDoc#classes()
+ */
+ public ClassDoc[] classes() {
+ return getFilteredClasses();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.javadoc.RootDoc#specifiedClasses()
+ */
+
+ public ClassDoc[] specifiedClasses() {
+ return getFilteredSpecifiedClasses();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.javadoc.RootDoc#specifiedPackages()
+ */
+ public PackageDoc[] specifiedPackages() {
+ return getFilteredSpecifiedPackages();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.javadoc.RootDoc#options()
+ */
+ public String[][] options() {
+
+ if (this.options == null) {
+ this.options = getOptions();
+ }
+
+ return this.options;
+ }
+
+ private String[][] getOptions() {
+
+ String innerOptions[][] = getInnerRootDoc().options();
+
+ /* Regenerate a new array of options that includes our default options */
+ ArrayList augmentedOptions = new ArrayList();
+
+ for (int i = 0; i < innerOptions.length; i++) {
+ String[] opt = innerOptions[i];
+ augmentedOptions.add(opt);
+ }
+
+ /* Ensure no warnings on our custom tags */
+ augmentedOptions.add(new String[] {
+ "-tag", ITagDefinitions.TAG_CAN_BE_SEEN_BY + ":X"}); //$NON-NLS-1$//$NON-NLS-2$
+
+ return (String[][]) augmentedOptions.toArray(new String[0][0]);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.javadoc.RootDoc#classNamed(java.lang.String)
+ */
+ public ClassDoc classNamed(String arg0) {
+ return ProxyFactory.getInstance().createClassDocProxy(
+ getInnerRootDoc().classNamed(arg0));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.javadoc.RootDoc#packageNamed(java.lang.String)
+ */
+ public PackageDoc packageNamed(String arg0) {
+ return ProxyFactory.getInstance().createPackageDocProxy(
+ getInnerRootDoc().packageNamed(arg0));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.javadoc.DocErrorReporter#printError(java.lang.String)
+ */
+ public void printError(String arg0) {
+ getInnerRootDoc().printError(arg0);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.javadoc.DocErrorReporter#printNotice(java.lang.String)
+ */
+ public void printNotice(String arg0) {
+ getInnerRootDoc().printNotice(arg0);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.javadoc.DocErrorReporter#printWarning(java.lang.String)
+ */
+ public void printWarning(String arg0) {
+ getInnerRootDoc().printWarning(arg0);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.javadoc.DocErrorReporter#printError(com.sun.javadoc.SourcePosition,
+ * java.lang.String)
+ */
+ public void printError(SourcePosition arg0, String arg1) {
+ getInnerRootDoc().printError(arg0, arg1);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.javadoc.DocErrorReporter#printNotice(com.sun.javadoc.SourcePosition,
+ * java.lang.String)
+ */
+ public void printNotice(SourcePosition arg0, String arg1) {
+ getInnerRootDoc().printNotice(arg0, arg1);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.javadoc.DocErrorReporter#printWarning(com.sun.javadoc.SourcePosition,
+ * java.lang.String)
+ */
+ public void printWarning(SourcePosition arg0, String arg1) {
+ getInnerRootDoc().printWarning(arg0, arg1);
+ }
+
+ private ClassDoc[] filterClasses(ClassDoc[] classes) {
+ ArrayList retClasses = new ArrayList();
+ for (int i = 0; i < classes.length; i++) {
+ ClassDoc classDoc = classes[i];
+ if (false == isFiltered(classDoc)) {
+ retClasses.add(ProxyFactory.getInstance().createClassDocProxy(
+ classDoc));
+ }
+
+ }
+ return (ClassDoc[]) retClasses.toArray(new ClassDoc[0]);
+ }
+
+ private boolean isFiltered(ClassDoc classDoc) {
+ return (AuroraDoclet.getNamespaceChecker()
+ .isClientPreventedToSee(classDoc.qualifiedName()));
+ }
+
+ private PackageDoc[] filterPackages(PackageDoc[] packages) {
+ ArrayList retPackages = new ArrayList();
+ for (int i = 0; i < packages.length; i++) {
+ PackageDoc packageDoc = packages[i];
+ if (false == isFiltered(packageDoc)) {
+ retPackages.add(ProxyFactory.getInstance()
+ .createPackageDocProxy(packageDoc));
+ }
+
+ }
+ return (PackageDoc[]) retPackages.toArray(new PackageDoc[0]);
+ }
+
+ private boolean isFiltered(PackageDoc packageDoc) {
+ return (AuroraDoclet.getNamespaceChecker()
+ .isClientPreventedToSee(packageDoc.name()));
+ }
+
+} \ No newline at end of file
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/SeeTagProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/SeeTagProxy.java
new file mode 100644
index 000000000..31583692f
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/SeeTagProxy.java
@@ -0,0 +1,76 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.MemberDoc;
+import com.sun.javadoc.PackageDoc;
+import com.sun.javadoc.SeeTag;
+
+
+/**
+ * Proxy to a SeeTag
+ */
+
+public class SeeTagProxy
+ extends TagProxy
+ implements SeeTag {
+
+ public SeeTagProxy(SeeTag innerSeeTag) {
+ super (innerSeeTag);
+ }
+
+ private SeeTag getInnerSeeTag() {
+ return (SeeTag)getInnerObject();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.SeeTag#referencedClass()
+ */
+ public ClassDoc referencedClass() {
+ return FACTORY.createClassDocProxy(getInnerSeeTag().referencedClass());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.SeeTag#referencedMember()
+ */
+ public MemberDoc referencedMember() {
+ return FACTORY.createMemberDocProxy(getInnerSeeTag().referencedMember());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.SeeTag#referencedPackage()
+ */
+ public PackageDoc referencedPackage() {
+ return FACTORY.createPackageDocProxy(getInnerSeeTag().referencedPackage());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.SeeTag#label()
+ */
+ public String label() {
+ return getInnerSeeTag().label();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.SeeTag#referencedClassName()
+ */
+ public String referencedClassName() {
+ return getInnerSeeTag().referencedClassName();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.SeeTag#referencedMemberName()
+ */
+ public String referencedMemberName() {
+ return getInnerSeeTag().referencedMemberName();
+ }
+
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/SerialFieldTagProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/SerialFieldTagProxy.java
new file mode 100644
index 000000000..c9dee1984
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/SerialFieldTagProxy.java
@@ -0,0 +1,73 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.SerialFieldTag;
+
+
+/**
+ * Proxy to a SerialFieldTag
+ */
+
+public class SerialFieldTagProxy
+ extends TagProxy
+ implements SerialFieldTag {
+
+ private Comparable comparable;
+
+ public SerialFieldTagProxy(SerialFieldTag innerSerialFieldTag) {
+ super (innerSerialFieldTag);
+ this.comparable = new ComparableProxy(innerSerialFieldTag);
+ }
+
+ private SerialFieldTag getInnerSerialFieldTag() {
+ return (SerialFieldTag)getInnerObject();
+ }
+
+ private Comparable getComparable() {
+ return comparable;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.SerialFieldTag#fieldTypeDoc()
+ */
+ public ClassDoc fieldTypeDoc() {
+ return FACTORY.createClassDocProxy(getInnerSerialFieldTag().fieldType());
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ public int compareTo(Object arg0) {
+ return getComparable().compareTo(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.SerialFieldTag#description()
+ */
+ public String description() {
+ return getInnerSerialFieldTag().description();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.SerialFieldTag#fieldName()
+ */
+ public String fieldName() {
+ return getInnerSerialFieldTag().fieldName();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.SerialFieldTag#fieldType()
+ */
+ public String fieldType() {
+ return getInnerSerialFieldTag().fieldType();
+ }
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/TagProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/TagProxy.java
new file mode 100644
index 000000000..b317a41eb
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/TagProxy.java
@@ -0,0 +1,82 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.Doc;
+import com.sun.javadoc.SourcePosition;
+import com.sun.javadoc.Tag;
+
+
+/**
+ * Proxy to a Tag
+ */
+
+public class TagProxy
+ extends Proxy
+ implements Tag {
+
+ public TagProxy(Tag innerTag) {
+ super (innerTag);
+ }
+
+ private Tag getInnerTag() {
+ return (Tag)getInnerObject();
+ }
+
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Tag#holder()
+ */
+ public Doc holder() {
+ return FACTORY.createDocProxy(getInnerTag().holder());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Tag#position()
+ */
+ public SourcePosition position() {
+ return getInnerTag().position();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Tag#firstSentenceTags()
+ */
+ public Tag[] firstSentenceTags() {
+ return FACTORY.createTagProxies(getInnerTag().firstSentenceTags());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Tag#inlineTags()
+ */
+ public Tag[] inlineTags() {
+ return FACTORY.createTagProxies(getInnerTag().inlineTags());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Tag#kind()
+ */
+ public String kind() {
+ return getInnerTag().kind();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Tag#name()
+ */
+ public String name() {
+ return getInnerTag().name();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Tag#text()
+ */
+ public String text() {
+ return getInnerTag().text();
+ }
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ThrowsTagProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ThrowsTagProxy.java
new file mode 100644
index 000000000..7f4922704
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/ThrowsTagProxy.java
@@ -0,0 +1,53 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.ThrowsTag;
+
+
+/**
+ * Proxy to a ThrowsTag
+ */
+
+public class ThrowsTagProxy
+ extends TagProxy
+ implements ThrowsTag {
+
+ public ThrowsTagProxy(ThrowsTag innerThrowsTag) {
+ super (innerThrowsTag);
+ }
+
+ private ThrowsTag getInnerThrowsTag() {
+ return (ThrowsTag)getInnerObject();
+ }
+
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ThrowsTag#exception()
+ */
+ public ClassDoc exception() {
+ return FACTORY.createClassDocProxy(getInnerThrowsTag().exception());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ThrowsTag#exceptionComment()
+ */
+ public String exceptionComment() {
+ return getInnerThrowsTag().exceptionComment();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.ThrowsTag#exceptionName()
+ */
+ public String exceptionName() {
+ return getInnerThrowsTag().exceptionName();
+ }
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/TypeProxy.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/TypeProxy.java
new file mode 100644
index 000000000..eb9f71bf8
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/proxies/TypeProxy.java
@@ -0,0 +1,59 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.proxies;
+
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.Type;
+
+
+/**
+ * Proxy to a Type
+ */
+
+public class TypeProxy
+ extends Proxy
+ implements Type {
+
+ public TypeProxy(Type innerType) {
+ super (innerType);
+ }
+
+ private Type getInnerType() {
+ return (Type)getInnerObject();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Type#asClassDoc()
+ */
+ public ClassDoc asClassDoc() {
+ return FACTORY.createClassDocProxy(getInnerType().asClassDoc());
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Type#dimension()
+ */
+ public String dimension() {
+ return getInnerType().dimension();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Type#qualifiedTypeName()
+ */
+ public String qualifiedTypeName() {
+ return getInnerType().qualifiedTypeName();
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.javadoc.Type#typeName()
+ */
+ public String typeName() {
+ return getInnerType().typeName();
+ }
+}
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/utils/AliasRegistry.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/utils/AliasRegistry.java
new file mode 100644
index 000000000..c03c0b22c
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/utils/AliasRegistry.java
@@ -0,0 +1,34 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.utils;
+
+import java.util.HashMap;
+
+/**
+ * Registry of aliases. Maps alias to value.
+ */
+
+public class AliasRegistry {
+
+ private HashMap aliasMap;
+
+ public AliasRegistry() {
+ this.aliasMap = new HashMap();
+ }
+
+ public void registerAlias(String alias, String value) {
+ this.aliasMap.put(alias.trim(), value.trim());
+ }
+
+ public String getAliasValue(String alias) {
+ return (String) this.aliasMap.get(alias);
+ }
+
+} \ No newline at end of file
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/utils/MapsGenerator.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/utils/MapsGenerator.java
new file mode 100644
index 000000000..bcf5dcd2f
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/utils/MapsGenerator.java
@@ -0,0 +1,177 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.utils;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.gmf.runtime.doclet.ITagDefinitions;
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.PackageDoc;
+import com.sun.javadoc.ProgramElementDoc;
+import com.sun.javadoc.RootDoc;
+import com.sun.javadoc.Tag;
+
+/**
+ * Generator for all canBeSeenBy maps. Traverse all packages, classes, and members to find
+ * @canbeSeenBy tags and records them in a map.
+ */
+
+public class MapsGenerator {
+
+ private static final String NAMESPACE_SEPARATOR = ","; //$NON-NLS-1$
+
+ private HashMap canBeSeenByMap = null;
+
+ private RootDoc root;
+
+ private AliasRegistry aliasRegistry;
+
+ public MapsGenerator(RootDoc root, AliasRegistry aliasRegistry) {
+ this.root = root;
+ this.aliasRegistry = aliasRegistry;
+
+ generateMaps();
+
+ printMaps();
+ }
+
+ public HashMap getCanBeSeeByMap() {
+ return this.canBeSeenByMap;
+ }
+
+ public AliasRegistry getAliasRegistry() {
+ return this.aliasRegistry;
+ }
+
+ private void generateMaps() {
+
+ this.canBeSeenByMap = new HashMap();
+
+ if (root.classes() != null) {
+ visitClassDocs(root.classes());
+ }
+
+ if (root.specifiedPackages() != null) {
+ visitPackageDocs(root.specifiedPackages());
+ }
+ }
+
+ private void visitClassDocs(ClassDoc classDocs[]) {
+ for (int i = 0; i < classDocs.length; i++) {
+ ClassDoc classDoc = classDocs[i];
+ visitClassDoc(classDoc);
+ }
+ }
+
+ private void visitClassDoc(ClassDoc classDoc) {
+
+ addVisibilityRules(classDoc);
+
+ addVisibilityRules(classDoc.constructors());
+
+ addVisibilityRules(classDoc.methods());
+
+ addVisibilityRules(classDoc.fields());
+
+ visitClassDocs(classDoc.innerClasses());
+
+ visitPackageDoc(classDoc.containingPackage());
+ }
+
+ private void visitPackageDocs(PackageDoc packageDocs[]) {
+ for (int i = 0; i < packageDocs.length; i++) {
+ PackageDoc packageDoc = packageDocs[i];
+ visitPackageDoc(packageDoc);
+ }
+ }
+
+ private void visitPackageDoc(PackageDoc packageDoc) {
+ addVisibilityRules(packageDoc.tags(ITagDefinitions.TAG_CAN_BE_SEEN_BY),
+ packageDoc.name());
+ }
+
+ private void addVisibilityRules(ProgramElementDoc programElementDocs[]) {
+ for (int i = 0; i < programElementDocs.length; i++) {
+ ProgramElementDoc programElementDoc = programElementDocs[i];
+ addVisibilityRules(programElementDoc);
+ }
+ }
+
+ private void addVisibilityRules(ProgramElementDoc programElementDoc) {
+ addVisibilityRules(programElementDoc
+ .tags(ITagDefinitions.TAG_CAN_BE_SEEN_BY), programElementDoc
+ .qualifiedName());
+ }
+
+ private void addVisibilityRules(Tag canBeSeenByTags[], String qualifiedName) {
+
+ for (int i = 0; i < canBeSeenByTags.length; i++) {
+ Tag tag = canBeSeenByTags[i];
+ addVisibilityRule(getCanBeSeeByMap(), qualifiedName, tag.text());
+ }
+ }
+
+ private void addVisibilityRule(HashMap map, String qualifiedName,
+ String allowedNamespace) {
+
+ String aliasValue = getAliasRegistry().getAliasValue(allowedNamespace);
+ if (aliasValue != null) {
+ allowedNamespace = aliasValue;
+ }
+
+ String allowedNamespaces[] = allowedNamespace
+ .split(NAMESPACE_SEPARATOR);
+
+ for (int i = 0; i < allowedNamespaces.length; i++) {
+ String singleNamespace = allowedNamespaces[i];
+
+ Set existingAllowedNamespaces = (Set) map.get(qualifiedName);
+
+ if (existingAllowedNamespaces == null) {
+ existingAllowedNamespaces = new HashSet();
+ map.put(qualifiedName, existingAllowedNamespaces);
+ }
+
+ existingAllowedNamespaces.add(singleNamespace);
+
+ }
+
+ }
+
+ private void printMaps() {
+
+ System.out.println();
+ System.out
+ .println("************************* START @canBeSeenBy Map ***************************"); //$NON-NLS-1$
+ System.out.println();
+
+ Set entries = getCanBeSeeByMap().entrySet();
+ for (Iterator iterEntry = entries.iterator(); iterEntry.hasNext();) {
+ Map.Entry entry = (Map.Entry) iterEntry.next();
+
+ Set namespaces = (Set) entry.getValue();
+ for (Iterator iterNamespace = namespaces.iterator(); iterNamespace
+ .hasNext();) {
+ String namespace = (String) iterNamespace.next();
+ System.out.println((String) entry.getKey() + "\t->\t" + namespace); //$NON-NLS-1$
+ }
+ }
+
+ System.out.println();
+ System.out
+ .println("************************* END @canBeSeenBy Map ***************************"); //$NON-NLS-1$
+ System.out.println();
+ }
+
+} \ No newline at end of file
diff --git a/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/utils/NamespaceChecker.java b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/utils/NamespaceChecker.java
new file mode 100644
index 000000000..67d86f55d
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/src/org/eclipse/gmf/runtime/doclet/utils/NamespaceChecker.java
@@ -0,0 +1,127 @@
+/*
+ *+------------------------------------------------------------------------+
+ *| Licensed Materials - Property of IBM |
+ *| (C) Copyright IBM Corp. 2005. All Rights Reserved. |
+ *| |
+ *| US Government Users Restricted Rights - Use, duplication or disclosure |
+ *| restricted by GSA ADP Schedule Contract with IBM Corp. |
+ *+------------------------------------------------------------------------+
+ */
+package org.eclipse.gmf.runtime.doclet.utils;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * Contains the logic to determine if a given qualified name is visible
+ * in the context and in the canBeSeenByMap provided to the constructor.
+ */
+
+public class NamespaceChecker {
+
+ private static final String WILDCARD = "*"; //$NON-NLS-1$
+
+ private final String clientContext;
+
+ private final HashMap canBeSeenByMap;
+
+ public NamespaceChecker(String clientContext, HashMap canBeSeenByMap) {
+ this.clientContext = clientContext;
+ this.canBeSeenByMap = canBeSeenByMap;
+ }
+
+ private String getClientContext() {
+ return this.clientContext;
+ }
+
+ private HashMap getCanBeSeenByMap() {
+ return this.canBeSeenByMap;
+ }
+
+ public boolean isClientPreventedToSee(String qualifiedName) {
+
+ /* By default clients are not prevented to see a given namespace */
+ boolean clientPreventedToSee = false;
+
+ /*
+ * We iterate through each namespace involved in the fully qualified
+ * name passed as parameter until a visibility rule is encountered. The
+ * iteration is perform from child namespace to parent namespace.
+ *
+ * e.g. com.ibm.xtool.common.core would be iterated as follows:
+ *
+ * com.ibm.xtool.common.core com.ibm.xtool.common com.ibm.xtool com.ibm
+ * com
+ */
+
+ boolean verdictMade = false;
+ String partialQualifiedName = qualifiedName;
+
+ while (verdictMade == false && partialQualifiedName.length() > 0) {
+
+ /* Get list of allowed client namespaces */
+ Set allowedClientNamespaces = (Set) getCanBeSeenByMap().get(
+ partialQualifiedName);
+
+ if (allowedClientNamespaces != null) {
+
+ /*
+ * Found a visibility rule, remember so we can exit walking
+ * through namespaces
+ */
+ verdictMade = true;
+
+ /*
+ * When rules are found, assume client is prevented to see
+ * unless a rule states otherwise
+ */
+ clientPreventedToSee = true;
+
+ /* Iterate through rules to see if one allows visibility */
+ for (Iterator iterAllowedClient = allowedClientNamespaces
+ .iterator(); clientPreventedToSee == true
+ && iterAllowedClient.hasNext();) {
+
+ /*
+ * The following cases are handled: Rule is "*" -> Everybody
+ * are allowed to see Rule ends with ".*" -> Everybody
+ * sharing namespace before ".*" are allowed to see
+ * Otherwise -> Only the namespace identical to the
+ * namespace identified in the rule is allowed
+ */
+ String allowedClient = (String) iterAllowedClient.next();
+ if (allowedClient.endsWith(WILDCARD)) {
+ if (allowedClient.length() == 1) {
+ clientPreventedToSee = false;
+ } else {
+ String allowedNamespace = allowedClient.substring(
+ 0, allowedClient.length() - 2 - 1);
+ if (getClientContext().startsWith(allowedNamespace)) {
+ clientPreventedToSee = false;
+ }
+ }
+ } else {
+ if (false == getClientContext().equals(allowedClient)) {
+ clientPreventedToSee = false;
+ }
+ }
+ }
+ }
+
+ /* Get next parent namespace */
+ int lastDot = partialQualifiedName.lastIndexOf('.');
+ if (lastDot == -1) {
+ /* No more parent, we are done iterating */
+ verdictMade = true;
+ } else {
+ partialQualifiedName = partialQualifiedName.substring(0,
+ lastDot);
+ }
+ }
+
+// System.out.println("******** " + qualifiedName + (clientPreventedToSee ? " Prevented" : " Allowed"));
+
+ return clientPreventedToSee;
+ }
+} \ No newline at end of file
diff --git a/doc/org.eclipse.gmf.runtime.doclet/tools.jar b/doc/org.eclipse.gmf.runtime.doclet/tools.jar
new file mode 100644
index 000000000..5b99722a1
--- /dev/null
+++ b/doc/org.eclipse.gmf.runtime.doclet/tools.jar
Binary files differ

Back to the top