[kaffe] CVS kaffe (robilad): Added missing gjdoc files
Kaffe CVS
cvs-commits at kaffe.org
Thu Dec 9 02:28:39 PST 2004
PatchSet 5583
Date: 2004/12/09 10:24:18
Author: robilad
Branch: HEAD
Tag: (none)
Log:
Added missing gjdoc files
Members:
tools/gjdoc/javalib/gnu/classpath/tools/StringToolkit.java:INITIAL->1.1
tools/gjdoc/javalib/gnu/classpath/tools/doclets/htmldoclet/ExternalDocSet.java:INITIAL->1.1
tools/gjdoc/javalib/gnu/classpath/tools/gjdoc/InheritDocTagImpl.java:INITIAL->1.1
tools/gjdoc/javalib/gnu/classpath/tools/gjdoc/TagContainer.java:INITIAL->1.1
===================================================================
Checking out kaffe/tools/gjdoc/javalib/gnu/classpath/tools/StringToolkit.java
RCS: /home/cvs/kaffe/kaffe/tools/gjdoc/javalib/gnu/classpath/tools/StringToolkit.java,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/tools/gjdoc/javalib/gnu/classpath/tools/StringToolkit.java Thu Dec 9 10:28:38 2004
@@ -0,0 +1,67 @@
+/* gnu.classpath.tools.StringToolkit
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA. */
+
+package gnu.classpath.tools;
+
+/**
+ * Provides various String-related helper methods.
+ *
+ * @author Julian Scheid
+ */
+public class StringToolkit
+{
+ /**
+ * Prevents instantiation.
+ */
+ private StringToolkit() {}
+
+ /**
+ * Return <code>haystack</code> with all occurrences of
+ * <code>needle</code> replaced by </code>replacement</code>.
+ *
+ * @param haystack the string to replace occurrences of <code>needle</code> in
+ * @param needle the substring to replace
+ * @param replacement the substring to replace <code>needle</code> with
+ *
+ * @return <code>haystack</code> with all occurrences of
+ * <code>needle</code> replaced by </code>replacement</code>.
+ */
+ public static String replace(String haystack, String needle, String replacement)
+ {
+ int ndx = haystack.indexOf(needle);
+ if (ndx < 0) {
+ return haystack;
+ }
+ else {
+ StringBuffer result = new StringBuffer();
+ result.append(haystack.substring(0, ndx));
+ result.append(replacement);
+ ndx += needle.length();
+ int ndx2;
+ while ((ndx2 = haystack.indexOf(needle, ndx)) >= 0) {
+ result.append(haystack.substring(ndx, ndx2));
+ result.append(replacement);
+ ndx = ndx2 + needle.length();
+ }
+ result.append(haystack.substring(ndx));
+ return result.toString();
+ }
+ }
+}
===================================================================
Checking out kaffe/tools/gjdoc/javalib/gnu/classpath/tools/doclets/htmldoclet/ExternalDocSet.java
RCS: /home/cvs/kaffe/kaffe/tools/gjdoc/javalib/gnu/classpath/tools/doclets/htmldoclet/ExternalDocSet.java,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/tools/gjdoc/javalib/gnu/classpath/tools/doclets/htmldoclet/ExternalDocSet.java Thu Dec 9 10:28:39 2004
@@ -0,0 +1,107 @@
+/* gnu.classpath.tools.doclets.htmldoclet.ExternalDocSet
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA. */
+
+package gnu.classpath.tools.doclets.htmldoclet;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import com.sun.javadoc.ClassDoc;
+
+public class ExternalDocSet
+{
+ private String url;
+ private String packageListDir;
+ private URL docSetDirectoryURL;
+
+ public String getPackageListDir()
+ {
+ return packageListDir;
+ }
+
+ public ExternalDocSet(String url,
+ String packageListDir)
+ {
+ this.url = url;
+ this.packageListDir = packageListDir;
+ }
+
+ private Set packageNames = new HashSet();
+
+ public void load(File targetDirectory)
+ throws IOException, MalformedURLException
+ {
+ if (!url.endsWith("/")) {
+ url += "/";
+ }
+
+ this.docSetDirectoryURL = new URL(targetDirectory.toURL(),
+ url);
+
+ URL packageListDirURL;
+ if (null != packageListDir) {
+ packageListDirURL = new URL(new File(System.getProperty("user.dir")).toURL(),
+ packageListDir);
+ }
+ else {
+ packageListDirURL = docSetDirectoryURL;
+ }
+
+ URL packageListURL = new URL(packageListDirURL,
+ "package-list");
+ InputStream in = packageListURL.openStream();
+ readPackages(in);
+ in.close();
+ }
+
+ public String getClassDocURL(String packageName, String typeName)
+ throws MalformedURLException
+ {
+ URL fileURL = new URL(docSetDirectoryURL,
+ packageName.replace('.', '/') + "/" + typeName + ".html");
+ return fileURL.toString();
+ }
+
+ protected void readPackages(InputStream in)
+ throws IOException
+ {
+ BufferedReader reader
+ = new BufferedReader(new InputStreamReader(in, "UTF-8"));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ line = line.trim();
+ packageNames.add(line);
+ }
+ }
+
+ public Set getPackageNames()
+ {
+ return packageNames;
+ }
+}
===================================================================
Checking out kaffe/tools/gjdoc/javalib/gnu/classpath/tools/gjdoc/InheritDocTagImpl.java
RCS: /home/cvs/kaffe/kaffe/tools/gjdoc/javalib/gnu/classpath/tools/gjdoc/InheritDocTagImpl.java,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/tools/gjdoc/javalib/gnu/classpath/tools/gjdoc/InheritDocTagImpl.java Thu Dec 9 10:28:39 2004
@@ -0,0 +1,86 @@
+/* gnu.classpath.tools.gjdoc.InheritDocTagImpl
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA. */
+
+package gnu.classpath.tools.gjdoc;
+
+import com.sun.javadoc.*;
+import java.util.*;
+import java.text.*;
+
+/**
+ * Represents the <code>inheritDoc</code> tag.
+ */
+public class InheritDocTagImpl
+ extends AbstractTagImpl
+{
+ private ClassDocImpl contextClass;
+ private MemberDocImpl contextMember;
+ private AbstractTagImpl contextTag;
+
+ public InheritDocTagImpl(ClassDocImpl contextClass,
+ MemberDocImpl contextMember,
+ AbstractTagImpl contextTag)
+ {
+ super("");
+ this.contextClass = contextClass;
+ this.contextMember = contextMember;
+ this.contextTag = contextTag;
+ }
+
+ public String kind() {
+ return "@inheritDoc";
+ }
+
+ public String name() {
+ return "@inheritDoc";
+ }
+
+ private TagContainer inheritedDoc;
+ private boolean inheritedDocInitialized = false;
+
+ private TagContainer getInheritedDoc()
+ {
+ if (!inheritedDocInitialized) {
+ inheritedDoc = DocImpl.findInheritedDoc(contextClass, contextMember, contextTag);
+ inheritedDocInitialized = true;
+ }
+ return inheritedDoc;
+ }
+
+ public Tag[] firstSentenceTags() {
+ TagContainer inheritedDoc = getInheritedDoc();
+ if (inheritedDoc != null) {
+ return inheritedDoc.firstSentenceTags();
+ }
+ else {
+ return null;
+ }
+ }
+
+ public Tag[] inlineTags() {
+ TagContainer inheritedDoc = getInheritedDoc();
+ if (inheritedDoc != null) {
+ return inheritedDoc.inlineTags();
+ }
+ else {
+ return null;
+ }
+ }
+}
===================================================================
Checking out kaffe/tools/gjdoc/javalib/gnu/classpath/tools/gjdoc/TagContainer.java
RCS: /home/cvs/kaffe/kaffe/tools/gjdoc/javalib/gnu/classpath/tools/gjdoc/TagContainer.java,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/tools/gjdoc/javalib/gnu/classpath/tools/gjdoc/TagContainer.java Thu Dec 9 10:28:39 2004
@@ -0,0 +1,35 @@
+/* gnu.classpath.tools.gjdoc.TagContainer
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA. */
+
+package gnu.classpath.tools.gjdoc;
+
+import com.sun.javadoc.Tag;
+
+import java.util.Map;
+
+/**
+ * Implemented by Doclet API classes that are associated with tags.
+ */
+interface TagContainer
+{
+ public Tag[] firstSentenceTags();
+ public Tag[] inlineTags();
+ public Map getTagMap();
+}
More information about the kaffe
mailing list