diff options
author | Thomas Fitzsimmons <fitzsim@redhat.com> | 2007-03-01 00:26:07 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@redhat.com> | 2007-03-01 00:26:07 +0000 |
commit | 7a510c3e2531682ca47fc78d068e55114abd371d (patch) | |
tree | 4547df71274328e9afc9460f1769c820b37bed6a | |
parent | a8e912b79b9a5d21248fb8964f1263eb6fdaa4f4 (diff) | |
download | classpath-7a510c3e2531682ca47fc78d068e55114abd371d.tar.gz |
2007-02-28 Thomas Fitzsimmons <fitzsim@redhat.com>
* INSTALL: Document --with-ecj-jar configure option and ecj jar
requirement for com.sun.tools.javac support.
* configure.ac: Add --with-ecj-jar configure option.
* gnu/classpath/Configuration.java.in (ECJ_JAR): New field.
* tools/Makefile.am: Build decendents of com and sun directories.
* resource/com/sun/tools/javac/messages.properties,
resource/sun/rmi/rmic/messages.properties,
tools/com/sun/javadoc/ClassDoc.java,
tools/com/sun/javadoc/ConstructorDoc.java,
tools/com/sun/javadoc/Doc.java,
tools/com/sun/javadoc/DocErrorReporter.java,
tools/com/sun/javadoc/Doclet.java,
tools/com/sun/javadoc/ExecutableMemberDoc.java,
tools/com/sun/javadoc/FieldDoc.java,
tools/com/sun/javadoc/MemberDoc.java,
tools/com/sun/javadoc/MethodDoc.java,
tools/com/sun/javadoc/PackageDoc.java,
tools/com/sun/javadoc/ParamTag.java,
tools/com/sun/javadoc/Parameter.java,
tools/com/sun/javadoc/ProgramElementDoc.java,
tools/com/sun/javadoc/RootDoc.java,
tools/com/sun/javadoc/SeeTag.java,
tools/com/sun/javadoc/SerialFieldTag.java,
tools/com/sun/javadoc/SourcePosition.java,
tools/com/sun/javadoc/Tag.java,
tools/com/sun/javadoc/ThrowsTag.java,
tools/com/sun/javadoc/Type.java,
tools/com/sun/javadoc/TypeVariable.java,
tools/com/sun/tools/doclets/Taglet.java,
tools/com/sun/tools/javac/Main.java,
tools/com/sun/tools/javac/Messages.java,
tools/sun/rmi/rmic/Main.java, tools/sun/rmi/rmic/Messages.java:
New files.
33 files changed, 2986 insertions, 2 deletions
@@ -1,3 +1,39 @@ +2007-02-28 Thomas Fitzsimmons <fitzsim@redhat.com> + + * INSTALL: Document --with-ecj-jar configure option and ecj jar + requirement for com.sun.tools.javac support. + * configure.ac: Add --with-ecj-jar configure option. + * gnu/classpath/Configuration.java.in (ECJ_JAR): New field. + * tools/Makefile.am: Build decendents of com and sun directories. + * resource/com/sun/tools/javac/messages.properties, + resource/sun/rmi/rmic/messages.properties, + tools/com/sun/javadoc/ClassDoc.java, + tools/com/sun/javadoc/ConstructorDoc.java, + tools/com/sun/javadoc/Doc.java, + tools/com/sun/javadoc/DocErrorReporter.java, + tools/com/sun/javadoc/Doclet.java, + tools/com/sun/javadoc/ExecutableMemberDoc.java, + tools/com/sun/javadoc/FieldDoc.java, + tools/com/sun/javadoc/MemberDoc.java, + tools/com/sun/javadoc/MethodDoc.java, + tools/com/sun/javadoc/PackageDoc.java, + tools/com/sun/javadoc/ParamTag.java, + tools/com/sun/javadoc/Parameter.java, + tools/com/sun/javadoc/ProgramElementDoc.java, + tools/com/sun/javadoc/RootDoc.java, + tools/com/sun/javadoc/SeeTag.java, + tools/com/sun/javadoc/SerialFieldTag.java, + tools/com/sun/javadoc/SourcePosition.java, + tools/com/sun/javadoc/Tag.java, + tools/com/sun/javadoc/ThrowsTag.java, + tools/com/sun/javadoc/Type.java, + tools/com/sun/javadoc/TypeVariable.java, + tools/com/sun/tools/doclets/Taglet.java, + tools/com/sun/tools/javac/Main.java, + tools/com/sun/tools/javac/Messages.java, + tools/sun/rmi/rmic/Main.java, tools/sun/rmi/rmic/Messages.java: + New files. + 2007-02-28 Keith Seitz <keiths@redhat.com> * gnu/classpath/jdwp/processor/MethodCommandSet.java @@ -111,6 +111,9 @@ Suggested Software - fluidsynth: a real-time SoundFont 2 based soft-synth http://www.fluidsynth.org/ + For enabling the com.sun.tools.javac support in tools.zip you + will a need jar file containing the Eclipse Java Compiler. + Otherwise com.sun.tools.javac will not be included in tools.zip. This package was designed to use the GNU standard for configuration and makefiles. To build and install do the following: @@ -147,6 +150,8 @@ gives a complete list. path to the jay executable --with-glibj-zip=ABS.PATH use prebuilt glibj.zip class library + --with-ecj-jar=ABS.PATH specify jar file containing the Eclipse Java + Compiler For more flags run configure --help. diff --git a/configure.ac b/configure.ac index d9654c736..25f9522e1 100644 --- a/configure.ac +++ b/configure.ac @@ -687,6 +687,19 @@ AC_SUBST(INIT_LOAD_LIBRARY) dnl ----------------------------------------------------------- +dnl Specify the jar file containing the Eclipse Java Compiler. If +dnl this option is not specified then the com.sun.tools.javac +dnl implementation will not be included in tools.zip. +dnl ----------------------------------------------------------- +AC_ARG_WITH([ecj-jar], + [AS_HELP_STRING([--with-ecj-jar=ABS.PATH], + [specify jar file containing the Eclipse Java Compiler])], + [ECJ_JAR=$withval] + ) +AC_SUBST(ECJ_JAR) +AM_CONDITIONAL(FOUND_ECJ_JAR, test -n "$ECJ_JAR") + +dnl ----------------------------------------------------------- dnl Should the VM explicitly run class initialization subfunctions for dnl java.lang.System? (default is false -- the subfunctions will be run dnl automatically by the class initializer) diff --git a/gnu/classpath/Configuration.java.in b/gnu/classpath/Configuration.java.in index 7f490d529..7fb864093 100644 --- a/gnu/classpath/Configuration.java.in +++ b/gnu/classpath/Configuration.java.in @@ -95,4 +95,10 @@ public interface Configuration */ boolean JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@; + + /** + * The Eclipse Java Compiler jar file for use by the + * com.sun.tools.javac implementation in tools.zip. + */ + String ECJ_JAR = "@ECJ_JAR@"; } diff --git a/resource/com/sun/tools/javac/messages.properties b/resource/com/sun/tools/javac/messages.properties new file mode 100644 index 000000000..58ba926f0 --- /dev/null +++ b/resource/com/sun/tools/javac/messages.properties @@ -0,0 +1,42 @@ +# messages.properties -- English language messages +# Copyright (C) 2007 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., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA. +# +# Linking this library statically or dynamically with other modules is +# making a combined work based on this library. Thus, the terms and +# conditions of the GNU General Public License cover the whole +# combination. +# +# As a special exception, the copyright holders of this library give you +# permission to link this library with independent modules to produce an +# executable, regardless of the license terms of these independent +# modules, and to copy and distribute the resulting executable under +# terms of your choice, provided that you also meet, for each linked +# independent module, the terms and conditions of the license of that +# module. An independent module is a module which is not derived from +# or based on this library. If you modify this library, you may extend +# this exception to your version of the library, but you are not +# obligated to do so. If you do not wish to do so, delete this +# exception statement from your version. + +Main.FailedToRead:failed to read {0} +Main.MalformedURL:malformed URL for {0} +Main.FailedToLoad:failed to load {0} from {1} +Main.FailedConstructor:failed to find ecj constructor +Main.FailedCompile:failed to find ecj compile method diff --git a/resource/sun/rmi/rmic/messages.properties b/resource/sun/rmi/rmic/messages.properties new file mode 100644 index 000000000..4c897fd5e --- /dev/null +++ b/resource/sun/rmi/rmic/messages.properties @@ -0,0 +1,38 @@ +# messages.properties -- English language messages +# Copyright (C) 2007 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., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA. +# +# Linking this library statically or dynamically with other modules is +# making a combined work based on this library. Thus, the terms and +# conditions of the GNU General Public License cover the whole +# combination. +# +# As a special exception, the copyright holders of this library give you +# permission to link this library with independent modules to produce an +# executable, regardless of the license terms of these independent +# modules, and to copy and distribute the resulting executable under +# terms of your choice, provided that you also meet, for each linked +# independent module, the terms and conditions of the license of that +# module. An independent module is a module which is not derived from +# or based on this library. If you modify this library, you may extend +# this exception to your version of the library, but you are not +# obligated to do so. If you do not wish to do so, delete this +# exception statement from your version. + +Main.InternalError:sun.rmi.rmic: failed to run rmic main method diff --git a/tools/Makefile.am b/tools/Makefile.am index 0241398f8..c1c5791b6 100755 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -14,6 +14,16 @@ error dunno how to setup the JCOMPILER and compile endif endif +if FOUND_ECJ_JAR +COM_SUN_TOOLS_JAVAC = com/sun/tools/javac +ABS_COM_SUN_TOOLS_JAVAC = $(srcdir)/$(COM_SUN_TOOLS_JAVAC) +ABS_COM_SUN_TOOLS_JAVAC_SRCS = $(ABS_COM_SUN_TOOLS_JAVAC)/*.java +else +COM_SUN_TOOLS_JAVAC = +ABS_COM_SUN_TOOLS_JAVAC = +ABS_COM_SUN_TOOLS_JAVAC_SRCS = +endif + if CREATE_WRAPPERS bin_SCRIPTS = bin_PROGRAMS = gappletviewer gjarsigner gkeytool \ @@ -100,6 +110,10 @@ EXTRA_DIST = toolwrapper.c gappletviewer.in gjarsigner.in gkeytool.in \ # All our example java source files TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*/*.java \ + $(srcdir)/com/sun/javadoc/*.java \ + $(srcdir)/com/sun/tools/doclets/*.java \ + $(ABS_COM_SUN_TOOLS_JAVAC_SRCS) \ + $(srcdir)/sun/rmi/rmic/*.java \ $(srcdir)/external/asm/org/objectweb/asm/*.java \ $(srcdir)/external/asm/org/objectweb/asm/attrs/*.java \ $(srcdir)/external/asm/org/objectweb/asm/commons/*.java \ @@ -154,11 +168,18 @@ $(TOOLS_ZIP): $(TOOLS_JAVA_FILES) find $(srcdir)/external/asm -name '*.java' -print > asm.lst AC=`echo $(JCOMPILER) | sed -e 's/UTF-8/ISO-8859-1/g'`; \ $$AC -g -d asm @asm.lst - find $(srcdir)/gnu/classpath/tools -name '*.java' -print > classes.lst + find $(srcdir)/gnu/classpath/tools \ + $(srcdir)/com/sun/javadoc \ + $(srcdir)/com/sun/tools/doclets \ + $(ABS_COM_SUN_TOOLS_JAVAC) \ + $(srcdir)/sun/rmi/rmic \ + -name '*.java' -print > classes.lst $(JCOMPILER) -g -d classes @classes.lst cat classes.lst asm.lst > all-classes.lst ## Copy over tools resource files. - @list=`cd $(top_srcdir)/resource && find gnu/classpath/tools -name \*.properties -print`; \ + @list=`cd $(top_srcdir)/resource && find gnu/classpath/tools \ + com/sun/javadoc com/sun/tools/doclets $(COM_SUN_TOOLS_JAVAC) \ + sun/rmi/rmic -name \*.properties -print`; \ for p in $$list; do \ dirname=classes/`dirname $$p`; \ if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \ diff --git a/tools/com/sun/javadoc/ClassDoc.java b/tools/com/sun/javadoc/ClassDoc.java new file mode 100644 index 000000000..a4fa40a7c --- /dev/null +++ b/tools/com/sun/javadoc/ClassDoc.java @@ -0,0 +1,322 @@ +/* ClassDoc.java -- Document a Java class or interface + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +public interface ClassDoc extends ProgramElementDoc, Type +{ + +/** + * This method tests whether or not the class represented by this object + * is abstract. + * + * @return <code>true</code> if the class is abstract, <code>false</code>, + * otherwise. + */ +public abstract boolean +isAbstract(); + +/*************************************************************************/ + +/** + * This method tests whether or not the class represented by this object + * is serializable. That is, whether or not the class implements the + * <code>java.io.Serializable</code> interface. This includes classes + * which are externalizable. + * + * @return <code>true</code> if the class is serializable, + * <code>false</code> otherwise. + */ +public abstract boolean +isSerializable(); + +/*************************************************************************/ + +/** + * This method tests whether or not the class represented by this object + * is externalizable. That is, whether or not the class implements the + * <code>java.io.Externalizable</code> interface. + * + * @return <code>true</code> if the class is externalizable, + * <code>false</code> otherwise. + */ +public abstract boolean +isExternalizable(); + +/*************************************************************************/ + +/** + * This method returns the serialization methods for the class + * represented by this object. Is the custom readObject/writeObject + * methods? + * + * @return The serialization methods for this class. + */ +public abstract MethodDoc[] +serializationMethods(); + +/*************************************************************************/ + +/** + * This method returns the list of fields that are serialized in this + * class. This will return either the list of fields with an + * "@serial" declaration, or, if it exists, the + * <code>serialPersistentField</code> field. + * + * @return The list of serializable fields. + */ +public abstract FieldDoc[] +serializableFields(); + +/*************************************************************************/ + +/** + * This method tests whether or not the class represented by this object + * specifically defines its serializable fields in a + * <code>serialPersistentFields</code> field. + * + * @return <code>true</code> if this class explicitly defines its + * serializable fields, <code>false</code> otherwise. + */ +public abstract boolean +definesSerializableFields(); + +/*************************************************************************/ + +/** + * This method returns the superclass of the class represented by this + * object. + * + * @return The superclass of this class. + */ +public abstract ClassDoc +superclass(); + +/*************************************************************************/ + +/** + * This method tests whether or not the class represented by this object is + * a subclass of the specified class. + * + * @param cls The <code>ClassDoc</code> object of the class to test against. + * + * @return <code>true</code> if this class is a subclass of the specified + * class, <code>false</code> otherwise. + */ +public abstract boolean +subclassOf(ClassDoc cls); + +/*************************************************************************/ + +/** + * This method returns this list of interfaces implemented (or in the case + * of interfaces, extended) by this class. This list will only include + * interfaces directly implemented by this class, not those inherited by + * interfaced implemented in this class. + * + * @return The list of interfaces this class implements. + */ +public abstract ClassDoc[] +interfaces(); + +/*************************************************************************/ + +/** + * This method returns the list of fields that are visible to the user in + * this class, or the list of all fields in this class. + * + * @param filtered if true, only return visible (included) fields; + * otherwise, return all fields. + * + * @return The list of visible fields in this class, or the list of + * all fields in this class. + */ +public abstract FieldDoc[] +fields(boolean filtered); + +/*************************************************************************/ + +/** + * This method returns the list of fields that are visible to the user in + * this class. Does this depend on the -private -protected, etc flags + * passed to javadoc? + * + * @return The list of visible fields in this class. + */ +public abstract FieldDoc[] +fields(); + +/*************************************************************************/ + +/** + * This method returns either the list of methods that are visible to + * the user in the class represented by this object, or a list of all + * methods, excluding constructor methods. + * + * @param filtered if true, only return visible (included) methods; + * otherwise, return all methods. + * + * @return The list of all methods in this class, or the list of + * visible methods in this class. + */ +public abstract MethodDoc[] +methods(boolean filtered); + +/*************************************************************************/ + +/** + * This method returns the list of methods that are visible to the user in + * the class represented by this object, excluding constructor methods. + * + * @return The list of visible methods in this class. + */ +public abstract MethodDoc[] +methods(); + +/*************************************************************************/ + +/** + * This method returns either the list of constructors that are + * visible to the user in the class represented by this object, or + * the list of all constructors. + * + * @param filtered if true, only return visible (included) + * constructors; otherwise, return all constructors. + * + * @return The list of all constructors in this class, or the list + * of visible constructors in this class. + */ +public abstract ConstructorDoc[] +constructors(boolean filtered); + +/*************************************************************************/ + +/** + * This method returns the list of constructors that are visible to the user + * in the class represented by this object. + * + * @return The list visible constructors in this class. + */ +public abstract ConstructorDoc[] +constructors(); + +/*************************************************************************/ + +/** + * This method returns the list of inner classes that are visible to + * the user within the class represented by this object. + * + * @return The list of visible inner classes for this object. + */ +public abstract ClassDoc[] +innerClasses(); + +/*************************************************************************/ + +/** + * This method returns the list of all inner classes within the class + * represented by this object, or the list of visible inner classes + * in this class. + * + * @param filtered if true, only return visible (included) inner + * classes; otherwise, return all inner classes. + * + * @return The list of all inner classes for this object, or the list + * of visible inner classes. + */ +public abstract ClassDoc[] +innerClasses(boolean filtered); + +/*************************************************************************/ + +/** + * This method returns a <code>ClassDoc</code> for the named class. The + * following search order is used: + * <p> + * <ol> + * <li>Fully qualified class name. + * <li>Inner classes within this class. + * <li>In the current package. + * <li>In the imports for this class. + * </ol> + * + * @param name The name of the class to find. + * + * @return The requested class, or <code>null</code> if the requested + * class cannot be found. + */ +public abstract ClassDoc +findClass(String name); + +/*************************************************************************/ + +/** + * This method returns the list of classes that are imported. This + * excludes any imports of complete packages. + * + * @return The list of imported classes. + */ +public abstract ClassDoc[] +importedClasses(); + +/*************************************************************************/ + +/** + * This method returns the list of packages that are imported. This + * excludes any individual class imports. + * + * @return The list of imported packages. + */ +public abstract PackageDoc[] +importedPackages(); + +/*************************************************************************/ + +/** + * This method returns the formal type parameters of this class. + * The returned array is empty if the class does not represent a + * parameterized type. + * + * @return The list of type parameters. + * @since 1.5 + */ +TypeVariable[] +typeParameters(); + +} // interface ClassDoc + diff --git a/tools/com/sun/javadoc/ConstructorDoc.java b/tools/com/sun/javadoc/ConstructorDoc.java new file mode 100644 index 000000000..e9db4591c --- /dev/null +++ b/tools/com/sun/javadoc/ConstructorDoc.java @@ -0,0 +1,57 @@ +/* ConstructorDoc.java -- Document a Java class constructor + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This interface is used for documenting constructors. + */ +public interface ConstructorDoc extends ExecutableMemberDoc +{ + +/** + * This method returns the qualified name of the constructor. What is this + * really? + * + * @return The qualified name of the constructor. + */ +public abstract String +qualifiedName(); + +} // interface ConstructorDoc + diff --git a/tools/com/sun/javadoc/Doc.java b/tools/com/sun/javadoc/Doc.java new file mode 100644 index 000000000..425c85718 --- /dev/null +++ b/tools/com/sun/javadoc/Doc.java @@ -0,0 +1,265 @@ +/* Doc.java -- Model of an item to document. + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This interface is the super-interface of all items that can have + * Javadoc comments associated with them. + */ +public interface Doc extends java.io.Serializable, Comparable +{ + +/** + * This method returns the text of the comment for this item, with all + * tags stripped. + * + * @return The comment text for this item. + */ +public abstract String +commentText(); + +/*************************************************************************/ + +/** + * This method returns an array of all the tags in this item. + * + * @return An array of tags for this item. + */ +public abstract Tag[] +tags(); + +/*************************************************************************/ + +/** + * This method returns an array of all the tags of the specified type + * in this item. + * + * @param tagtype The name of the tag type to return. + * + * @return A list of all tags of the specified type. + */ +public abstract Tag[] +tags(String tagtype); + +/*************************************************************************/ + +/** + * This method returns an array of all tags of the "@see" type. + * + * @return An array of tags of the "@see" type + */ +public abstract SeeTag[] +seeTags(); + +/*************************************************************************/ + +/** + * This method returns the comment text as an array of tags. This will + * include any inline tags, but no regular tags. Regular text is returned + * as a type of <code>Text</code>. Inline "@see" tags are returned as + * type <code>SeeTag</code>. + * + * @return The comment text as tags. + */ +public abstract Tag[] +inlineTags(); + +/*************************************************************************/ + +/** + * This method returns the first sentence of the comment text as an array + * of tags. This will include any inline tags, but no regular tags. + * Regular text is returned as a type of <code>Text</code>. Inline "@see" + * tags are returned as type <code>SeeTag</code>. + * + * @return An array of tags representing the first sentence of the comment + * text. + */ +public abstract Tag[] +firstSentenceTags(); + +/*************************************************************************/ + +/** + * This method returns the text of the comment in an unprocessed format. + * Any Javadoc tags will remain as written in the text. + * + * @return The unprocessed comment text. + */ +public abstract String +getRawCommentText(); + +/*************************************************************************/ + +/** + * This method sets the unprocessed comment text for this item. + * + * @param rawtext The unprocessed comment text for this itme. + */ +public abstract void +setRawCommentText(String rawtext); + +/*************************************************************************/ + +/** + * This method returns the name of this item. + * + * @return The name of this item. + */ +public abstract String +name(); + +/*************************************************************************/ + +/** + * This method tests whether or not this item is a field. + * + * @return <code>true</code> if this item is a field, <code>false</code> + * otherwise. + */ +public abstract boolean +isField(); + +/*************************************************************************/ + +/** + * This method tests whether or not this item is a method. + * + * @return <code>true</code> if this item is a method, <code>false</code> + * otherwise. + */ +public abstract boolean +isMethod(); + +/*************************************************************************/ + +/** + * This method tests whether or not this item is a constructor. + * + * @return <code>true</code> if this item is a constructor, + * <code>false</code> otherwise. + */ +public abstract boolean +isConstructor(); + +/*************************************************************************/ + +/** + * This method tests whether or not this item is an interface. + * + * @return <code>true</code> if this item is an interface, + * <code>false</code> otherwise. + */ +public abstract boolean +isInterface(); + +/*************************************************************************/ + +/** + * This method tests whether or not this item is an exception. + * + * @return <code>true</code> if this item is an exception, + * <code>false</code> otherwise. + */ +public abstract boolean +isException(); + +/*************************************************************************/ + +/** + * This method tests whether or not this item is an error. + * + * @return <code>true</code> if this item is an error, + * <code>false</code> otherwise. + */ +public abstract boolean +isError(); + +/*************************************************************************/ + +/** + * This method tests whether or not this item is a class. Interfaces + * do not count as classes. + * + * @return <code>true</code> if this item is a class, + * <code>false</code> otherwise. + */ +public abstract boolean +isClass(); + +/*************************************************************************/ + +/** + * This method tests whether or not this item is an ordinary class. An + * ordinary class is a class that is not an exception or an error. + * Interfaces also do not count because they are not considered classes at + * all. + * + * @return <code>true</code> if this item is an ordinary class, + * <code>false</code> otherwise. + */ +public abstract boolean +isOrdinaryClass(); + +/*************************************************************************/ + +/** + * This method tests whether or not this item is part of the active set, + * whatever that is. + * + * @return <code>true</code> if this item is part of the active set, + * <code>false</code> otherwise. + */ +public abstract boolean +isIncluded(); + +/*************************************************************************/ + +/** + * This method returns the location of the item within the Java + * source code. + * + * @return an object describing the file, line and column where this + * item is defined. + */ +public abstract SourcePosition +position(); + +} // interface Doc + diff --git a/tools/com/sun/javadoc/DocErrorReporter.java b/tools/com/sun/javadoc/DocErrorReporter.java new file mode 100644 index 000000000..c4d05e700 --- /dev/null +++ b/tools/com/sun/javadoc/DocErrorReporter.java @@ -0,0 +1,77 @@ +/* DocErrorReporter.java -- Log errors/warnings during doc generation. + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This interface provides a mechanism for a doclet to log messages + * during its run. + */ +public interface DocErrorReporter +{ + +/** + * This method prints the specified error message. + * + * @param err The error message to print. + */ +public abstract void +printError(String err); + +/*************************************************************************/ + +/** + * This method prints the specified warning message. + * + * @param warn The warning message to print. + */ +public abstract void +printWarning(String warn); + +/*************************************************************************/ + +/** + * This method prints the specifed message. + * + * @param msg The message to print. + */ +public abstract void +printNotice(String notice); + +} // interface DocErrorReporter + diff --git a/tools/com/sun/javadoc/Doclet.java b/tools/com/sun/javadoc/Doclet.java new file mode 100644 index 000000000..7ce4b29ef --- /dev/null +++ b/tools/com/sun/javadoc/Doclet.java @@ -0,0 +1,99 @@ +/* Doclet.java -- Doclet API + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This class documents the method that must be implemented by a doclet. + * It may be used as the superclass of a doclet, but this is not required. + * As long as the doclet implements the <code>start</code> method, all is ok. + */ +public abstract class Doclet +{ + +/** + * This is the entry point to a doclet. All doclets must implement this + * method. + * + * @param rd The <code>RootDoc</code> instance for this javadoc run. + * + * @return <code>true</code> on success, <code>false</code> on failure. + */ +public static boolean +start(RootDoc root) +{ + return(false); +} + +/*************************************************************************/ + +/** + * This method returns the number of arguments to the option, including + * the option itself. This is not required of doclets. + * + * @param opt The option to check. + * + * @return The number of arguments to the option, or zero if the option is + * unknown, or a negative number if an error occurred. + */ +public static int +optionLength(String opt) +{ + return(0); +} + +/*************************************************************************/ + +/** + * This method is called to verify that the options supplied by the caller + * are valid. This is not required of doclets. + * + * @param opts The list of options supplied by the user. + * @param logger A mechanism for this method to report errors to the user. + * + * @return <code>true</code> if the options are valid, <code>false</code> + * otherwise. + */ +public static boolean +validOptions(String[][] opts, DocErrorReporter logger) +{ + return(true); +} + +} // class Doclet + diff --git a/tools/com/sun/javadoc/ExecutableMemberDoc.java b/tools/com/sun/javadoc/ExecutableMemberDoc.java new file mode 100644 index 000000000..8d4ddab66 --- /dev/null +++ b/tools/com/sun/javadoc/ExecutableMemberDoc.java @@ -0,0 +1,138 @@ +/* ExecutableMemberDoc.java -- Document methods and constructors + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This is the super-interface for interfaces describing constructors and + * methods. + */ +public interface ExecutableMemberDoc extends MemberDoc +{ + +/** + * This method returns a list of all the execeptions that are declared + * to be thrown in this method or constructor. + * + * @return The list of exceptions for this method. + */ +public abstract ClassDoc[] +thrownExceptions(); + +/*************************************************************************/ + +/** + * This method tests whether or not this method/constructor is native. + * + * @return <code>true</code> if the method is native, <code>false</code> + * otherwise. + */ +public abstract boolean +isNative(); + +/*************************************************************************/ + +/** + * This method tests whether or not this method/constructor is + * synchronized. + * + * @return <code>true</code> if the method is synchronized, + * <code>false</code> otherwise. + */ +public abstract boolean +isSynchronized(); + +/*************************************************************************/ + +/** + * This method returns the list of parameters for this method/constructor. + * + * @return The list of parameters for this method. + */ +public abstract Parameter[] +parameters(); + +/*************************************************************************/ + +/** + * This method returns the list of "@throws" and "@exception" tags in this + * method/constructor. + * + * @return The list of exception doc tags. + */ +public abstract ThrowsTag[] +throwsTags(); + +/*************************************************************************/ + +/** + * This method return the list of "@param" tags in this method/constructor. + * + * @return The list of parameter doc tags for this method. + */ +public abstract ParamTag[] +paramTags(); + +/*************************************************************************/ + +/** + * This method returns the signature of this method in pseudo-code format, + * with fully qualified class references. For example, the method + * <code>read(String str, boolean bool)</code> would have the signature + * <code>(java.lang.String, boolean)</code> returned by this method. + * + * @return The signature for this method. + */ +public abstract String +signature(); + +/*************************************************************************/ + +/** + * This method returns the signature of this method in pseudo-code format, + * with uqualified class references. For example, the method + * <code>read(String str, boolean bool)</code> would have the signature + * <code>(String, boolean)</code> returned by this method. + * + * @return The signature for this method. + */ +public abstract String +flatSignature(); + +} // interface ExecutableMemberDoc + diff --git a/tools/com/sun/javadoc/FieldDoc.java b/tools/com/sun/javadoc/FieldDoc.java new file mode 100644 index 000000000..a5e48c4c1 --- /dev/null +++ b/tools/com/sun/javadoc/FieldDoc.java @@ -0,0 +1,113 @@ +/* FieldDoc.java -- Document a field + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This package is used for documenting fields. + */ +public interface FieldDoc extends MemberDoc +{ + +/** + * This method returns the type of this field. + * + * @return The type of this field. + */ +public abstract Type +type(); + +/*************************************************************************/ + +/** + * This method tests whether or not the field is transient. + * + * @return <code>true</code> if the field is transient, <code>false</code> + * otherwise. + */ +public abstract boolean +isTransient(); + +/*************************************************************************/ + +/** + * This method tests whether or not the field is volatile. + * + * @return <code>true</code> if the field is volatile, <code>false</code> + * otherwise. + */ +public abstract boolean +isVolatile(); + +/*************************************************************************/ + +/** + * This method returns a list of all "@serialField" tags defined in this + * field. + * + * @return The list of "@serialField" tags for this field. + */ +public abstract SerialFieldTag[] +serialFieldTags(); + +/*************************************************************************/ + +/** + * This method returns the value of this static field. + * + * @return The value of this static field. + */ +public abstract Object +constantValue(); + + +/*************************************************************************/ + +/** + * This method returns the value of this static field converted to a + * human-readable string. + * + * @return The value of this static field as a human-readable string. + */ +public abstract String +constantValueExpression(); + + + +} // interface FieldDoc + diff --git a/tools/com/sun/javadoc/MemberDoc.java b/tools/com/sun/javadoc/MemberDoc.java new file mode 100644 index 000000000..8448f12c5 --- /dev/null +++ b/tools/com/sun/javadoc/MemberDoc.java @@ -0,0 +1,60 @@ +/* MemberDoc.java -- Common ops for documenting fields, methods, + and constructors + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This is the common super-interface for documentation about fields, + * methods, and constructors. + */ +public interface MemberDoc extends ProgramElementDoc +{ + +/** + * This method tests whether the member in question was created implicitly + * by the compiler. + * + * @return <code>true</code> if this member was synthesized by the compiler, + * </code>false</code> otherwise. + */ +public abstract boolean +isSynthetic(); + +} // interface MemberDoc + diff --git a/tools/com/sun/javadoc/MethodDoc.java b/tools/com/sun/javadoc/MethodDoc.java new file mode 100644 index 000000000..a24b8ec09 --- /dev/null +++ b/tools/com/sun/javadoc/MethodDoc.java @@ -0,0 +1,80 @@ +/* MethodDoc.java -- Document a method + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This interface is used for documenting ordinary (ie, non-constructor) + * methods. + */ +public interface MethodDoc extends ExecutableMemberDoc +{ + +/** + * This method tests whether or not the method to be documented is abstract. + * + * @return <code>true</code> if the method is abstract, <code>false</code> + * otherwise. + */ +public abstract boolean +isAbstract(); + +/*************************************************************************/ + +/** + * This method returns the return type of the method to be documented. + * + * @return The return type of the method to be documented. + */ +public abstract Type +returnType(); + +/*************************************************************************/ + +/** + * This method returns the class containing the method that this method is + * overriding. + * + * @return The class containing the method that this method is overriding, + * or <code>null</code> if this class is not overriding a method. + */ +public abstract ClassDoc +overriddenClass(); + +} // interface MethodDoc + diff --git a/tools/com/sun/javadoc/PackageDoc.java b/tools/com/sun/javadoc/PackageDoc.java new file mode 100644 index 000000000..d544acf5b --- /dev/null +++ b/tools/com/sun/javadoc/PackageDoc.java @@ -0,0 +1,109 @@ +/* PackageDoc.java -- Document a package + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +public interface PackageDoc extends Doc +{ + +/** + * This method returns a list of all the classes and interfaces in + * this package. This list will included exceptions and errors. + * + * @return The list of classes and interfaces for this package. + */ +public abstract ClassDoc[] +allClasses(); + +/*************************************************************************/ + +/** + * This method returns the list of ordinary classes in this package. This + * list will not include any interface, exceptions or errors. + * + * @return The list of ordinary classes in this package. + */ +public abstract ClassDoc[] +ordinaryClasses(); + +/*************************************************************************/ + +/** + * This method returns the list of exceptions in this package. + * + * @return The list of exceptions in this package. + */ +public abstract ClassDoc[] +exceptions(); + +/*************************************************************************/ + +/** + * This method returns the list of errors in this package. + * + * @return The list of errors in this package. + */ +public abstract ClassDoc[] +errors(); + +/*************************************************************************/ + +/** + * This method returns the list of interfaces in this package. + * + * @return The list of interfaces in this package. + */ +public abstract ClassDoc[] +interfaces(); + +/*************************************************************************/ + +/** + * This method returns a <code>ClassDoc</code> instance for the specified + * class. + * + * @param name The name of the class to return. + * + * @return The requested <code>ClassDoc</code> or <code>null</code> if + * this class not part of this javadoc run. + */ +public abstract ClassDoc +findClass(String cls); + +} // interface PackageDoc + diff --git a/tools/com/sun/javadoc/ParamTag.java b/tools/com/sun/javadoc/ParamTag.java new file mode 100644 index 000000000..94358637e --- /dev/null +++ b/tools/com/sun/javadoc/ParamTag.java @@ -0,0 +1,66 @@ +/* ParamTag.java -- Documentation tag for method parameters + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This interface represents an "@param" tag. + */ +public interface ParamTag extends Tag +{ + +/** + * This method returns the comment text for the parameter. + * + * @return The comment text for the parameter. + */ +public abstract String +parameterComment(); + +/*************************************************************************/ + +/** + * This method returns the name of the parameter. + * + * @return The name of the parameter. + */ +public abstract String +parameterName(); + +} // interface ParamTag + diff --git a/tools/com/sun/javadoc/Parameter.java b/tools/com/sun/javadoc/Parameter.java new file mode 100644 index 000000000..a359a5d9e --- /dev/null +++ b/tools/com/sun/javadoc/Parameter.java @@ -0,0 +1,88 @@ +/* Parameter.java -- Information about parameters to methods. + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This interface models a parameter to a method. + */ +public interface Parameter extends java.io.Serializable +{ + +/** + * This method returns the type of the parameter. + * + * @return The parameter type. + */ +public abstract Type +type(); + +/*************************************************************************/ + +/** + * This method returns the name of the parameter. + * + * @return The parameter name. + */ +public abstract String +name(); + +/*************************************************************************/ + +/** + * This method returns the name of the type of the parameter as a + * <code>String</code>. + * + * @return The name of the type of this parameter. + */ +public abstract String +typeName(); + +/*************************************************************************/ + +/** + * This method returns this parameter as a <code>String</code> that + * contains both the type name and parameter name. + * + * @return This parameter as a <code>String</code>. + */ +public abstract String +toString(); + +} // interaface Parameter + diff --git a/tools/com/sun/javadoc/ProgramElementDoc.java b/tools/com/sun/javadoc/ProgramElementDoc.java new file mode 100644 index 000000000..0d6dd4640 --- /dev/null +++ b/tools/com/sun/javadoc/ProgramElementDoc.java @@ -0,0 +1,170 @@ +/* ProgramElementDoc.java -- Common ops for all program elements. + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This is the comment super-interface of all items that are "program + * elements". This includes classes, interfaces, fields, constructors, + * and methods. + */ +public interface ProgramElementDoc extends Doc +{ + +/** + * This method returns the class which contains this element. If this + * is a class that is not an inner class, <code>null</code> will be + * returned. + * + * @returned The class element that contains this item, or <code>null</code> + * if this item is a class that is not an inner class. + */ +public abstract ClassDoc +containingClass(); + +/*************************************************************************/ + +/** + * This method returns the package which contains this element. If this + * element is in the default generic package, then the name of the + * package element returned will be "". + * + * @return The package element that contains this item. + */ +public abstract PackageDoc +containingPackage(); + +/*************************************************************************/ + +/** + * This method returns the fully qualified name of this element. + * + * @return The fully qualified name of this element. + */ +public abstract String +qualifiedName(); + +/*************************************************************************/ + +/** + * This method returns the modifier specificier number, which is what? + * + * @return The modifier for this element. + */ +public abstract int +modifierSpecifier(); + +/*************************************************************************/ + +/** + * This method returns a string with the element modifiers. For example, + * the modifiers of a method declaration might be "protected abstract". + * + * @return The modifier string. + */ +public abstract String +modifiers(); + +/*************************************************************************/ + +/** + * This method tests whether or not this element is public. + * + * @return <code>true</code> if this element is public, <code>false</code> + * otherwise. + */ +public abstract boolean +isPublic(); + +/*************************************************************************/ + +/** + * This method tests whether or not this element is protected. + * + * @return <code>true</code> if this element is protected, <code>false</code> + * otherwise. + */ +public abstract boolean +isProtected(); + +/*************************************************************************/ + +/** + * This method tests whether or not this element is private. + * + * @return <code>true</code> if this element is private, <code>false</code> + * otherwise. + */ +public abstract boolean +isPrivate(); + +/*************************************************************************/ + +/** + * This method tests whether or not this element is package private. + * + * @return <code>true</code> if this element is package private, + * <code>false</code> otherwise. + */ +public abstract boolean +isPackagePrivate(); + +/*************************************************************************/ + +/** + * This method tests whether or not this element is static. + * + * @return <code>true</code> if this element is static, <code>false</code> + * otherwise. + */ +public abstract boolean +isStatic(); + +/*************************************************************************/ + +/** + * This method tests whether or not this element is final. + * + * @return <code>true</code> if this element is final, <code>false</code> + * otherwise. + */ +public abstract boolean +isFinal(); + +} // interface ProgramElementDoc + diff --git a/tools/com/sun/javadoc/RootDoc.java b/tools/com/sun/javadoc/RootDoc.java new file mode 100644 index 000000000..064215408 --- /dev/null +++ b/tools/com/sun/javadoc/RootDoc.java @@ -0,0 +1,112 @@ +/* RootDoc.java -- Information about a javadoc run. + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package com.sun.javadoc; + +/** + * This interface is the root of the javadoc application. All the properties and + * arguments are attached to the class that will implements this interface. You + * can retrieve all the options of the tool with this interface. + */ +public interface RootDoc extends Doc, DocErrorReporter +{ + + /** + * This method returns the command line element used to invoke this instance + * of javadoc. + * + * @return The command line arguments for this run. + */ + public abstract String[][] options(); + + /** ********************************************************************** */ + + /** + * This method returns the list of packages that were specified on the command + * line. + * + * @return The packages specified on the command line. + */ + public abstract PackageDoc[] specifiedPackages(); + + /** ********************************************************************** */ + + /** + * This method returns the list of classes that were specified on the command + * line. + * + * @return The classes specified on the command line. + */ + public abstract ClassDoc[] specifiedClasses(); + + /** ********************************************************************** */ + + /** + * This method returns the list of classes and interfaces to be documented. + * + * @return The list of classes and interfaces to be documented. + */ + public abstract ClassDoc[] classes(); + + /** ********************************************************************** */ + + /** + * This method returns a <code>ClassDoc</code> instance for the name class + * or interface. + * + * @param name + * The class or interface to look up. + * @return The requested <code>ClassDoc</code>, or null if the specified + * class is not part of this javadoc run. + */ + public abstract ClassDoc classNamed(String name); + + /** ********************************************************************** */ + + /** + * This method returns a <code>PackageDoc</code> instance for the named + * package. + * + * @param name + * The package to look up. + * @return The requested <code>PackageDoc</code>, or null if the specified + * package is not part of this javadoc run. + */ + public abstract PackageDoc packageNamed(String name); + +} // interface RootDoc + diff --git a/tools/com/sun/javadoc/SeeTag.java b/tools/com/sun/javadoc/SeeTag.java new file mode 100644 index 000000000..12a2e934b --- /dev/null +++ b/tools/com/sun/javadoc/SeeTag.java @@ -0,0 +1,109 @@ +/* SeeTag.java -- Information about "@see" tags. + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This interface models an "@see" tag. + */ +public interface SeeTag extends Tag +{ + +/** + * This method returns the label for this tag. What is this???? + * + * @return The label for this tag. + */ +public abstract String +label(); + +/*************************************************************************/ + +/** + * This method returns the package of the referenced item. + * + * @return The package of the referenced item, or <code>null</code> if no + * package is found. + */ +public abstract PackageDoc +referencedPackage(); + +/*************************************************************************/ + +/** + * This method returns the name of the class referenced in the tag. + * + * @return The name of the class referenced in the tag. + */ +public abstract String +referencedClassName(); + +/*************************************************************************/ + +/** + * This method returns a <code>ClassDoc</code> instance for the class + * referenced in the tag. + * + * @return A <code>ClassDoc</code> for the class referenced in the tag. + */ +public abstract ClassDoc +referencedClass(); + +/*************************************************************************/ + +/** + * This method returns the name of the member referenced in the tag. + * + * @return The name of the member referenced in the tag. + */ +public abstract String +referencedMemberName(); + +/*************************************************************************/ + +/** + * This method returns a <code>MemberDoc</code> instance for the member + * referenced in the tag. + * + * @return A <code>MemberDoc</code> for the member referenced in the tag. + */ +public abstract MemberDoc +referencedMember(); + +} // interface SeeTag + diff --git a/tools/com/sun/javadoc/SerialFieldTag.java b/tools/com/sun/javadoc/SerialFieldTag.java new file mode 100644 index 000000000..9f5fa9acc --- /dev/null +++ b/tools/com/sun/javadoc/SerialFieldTag.java @@ -0,0 +1,102 @@ +/* SerialFieldTag.java -- Information about the "@serialField" tag. + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This interface models the "@serialField" tag. + */ +public interface SerialFieldTag extends Tag, Comparable +{ + +/** + * This method returns the name of the field. + * + * @return The name of the field. + */ +public abstract String +fieldName(); + +/*************************************************************************/ + +/** + * This method returns the type name of the field. + * + * @return The type name of the field. + */ +public abstract String +fieldType(); + +/*************************************************************************/ + +/** + * This method returns a <code>ClassDoc</code> instance for the type of + * the field. What about primitive types??? + * + * @return A <code>ClassDoc</code> for the field type. + */ +public abstract ClassDoc +fieldTypeDoc(); + +/*************************************************************************/ + +/** + * This method returns the description of the field. + * + * @return The description of the field. + */ +public abstract String +description(); + +/*************************************************************************/ + +/** + * This method compares this object with the specified object in order to + * determine proper ordering. + * + * @param obj The object to compare against. + * + * @return A negative number if this object is less than the specified + * object, zero if the objects are equal, or a positive number if this object + * is greater than the specified object. + */ +public abstract int +compareTo(Object obj); + +} // interface SerialFieldTag + diff --git a/tools/com/sun/javadoc/SourcePosition.java b/tools/com/sun/javadoc/SourcePosition.java new file mode 100644 index 000000000..fff25595f --- /dev/null +++ b/tools/com/sun/javadoc/SourcePosition.java @@ -0,0 +1,68 @@ +/* SourcePosition.java -- Model of a location in a source file. + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +import java.io.File; + +/** + * Represents a location in a source file. This is used by {@link + * Doc} to specify at which location an item is defined. + */ +public interface SourcePosition +{ + /** + * Return a File object pointing to the source file. + */ + public File file(); + + /** + * Return the 1-based line number within the source file. + */ + public int line(); + + /** + * Return the 1-based column number within the source file. + */ + public int column(); + + /** + * Return a string in the format "file.toString():line" + */ + public String toString(); +} diff --git a/tools/com/sun/javadoc/Tag.java b/tools/com/sun/javadoc/Tag.java new file mode 100644 index 000000000..f03221273 --- /dev/null +++ b/tools/com/sun/javadoc/Tag.java @@ -0,0 +1,107 @@ +/* Tag.java -- Common operations on Javadoc tags. + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This is the super-interface for all Javadoc tags. + */ +public interface Tag extends java.io.Serializable +{ +/** + * This method returns the name of the tag. + * + * @return The name of the tag. + */ +public abstract String +name(); + +/*************************************************************************/ + +/** + * This method returns the kind of tag. ???? + * + * @return The kind of the tag. + */ +public abstract String +kind(); + +/*************************************************************************/ + +/** + * This method returns the text for this tag. + * + * @return The text for this tag. + */ +public abstract String +text(); + +/*************************************************************************/ + +/** + * This method returns the tag as a <code>String</code>. What kind of + * string? + * + * @return This tag as a <code>String</code>. + */ +public abstract String +toString(); + +/*************************************************************************/ + +/** + * This method returns the inline tags for this comment. + * + * @return The inline tags for this comment. + */ +public abstract Tag[] +inlineTags(); + +/*************************************************************************/ + +/** + * This method returns the first sentence of the doc comment as an array + * of <code>Tag</code>'s. + * + * @return The first sentence of the comment as tags. + */ +public abstract Tag[] +firstSentenceTags(); + +} // interface Tag + diff --git a/tools/com/sun/javadoc/ThrowsTag.java b/tools/com/sun/javadoc/ThrowsTag.java new file mode 100644 index 000000000..72a43949e --- /dev/null +++ b/tools/com/sun/javadoc/ThrowsTag.java @@ -0,0 +1,76 @@ +/* ThrowsTag.java -- Information about "@throws" and "@exception" tags. + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This interface models an "@exception" or "@throws" tag. + */ +public interface ThrowsTag extends Tag +{ + +/** + * This method returns the name of the exception. + * + * @return The name of the exception. + */ +public abstract String +exceptionName(); + +/*************************************************************************/ + +/** + * This method returns the comment text of the exception. + * + * @return The comment text of the exception. + */ +public abstract String +exceptionComment(); + +/*************************************************************************/ + +/** + * This method returns the exception class as a <code>ClassDoc</code>. + * + * @return The exception class as a <code>ClassDoc</code>. + */ +public abstract ClassDoc +exception(); + +} // interface ThrowsTag + diff --git a/tools/com/sun/javadoc/Type.java b/tools/com/sun/javadoc/Type.java new file mode 100644 index 000000000..8d0bd145c --- /dev/null +++ b/tools/com/sun/javadoc/Type.java @@ -0,0 +1,120 @@ +/* Type.java -- Documentation information about Java types. + Copyright (C) 1999 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This class is used for holding information about Java types needed for + * documentation. + */ +public interface Type extends java.io.Serializable +{ + +/** + * This method returns the unqualified name of the type, excluding any array + * dimension information or brackets. + * + * @return The unqualified type name, sans array information or brackets. + */ +public abstract String +typeName(); + +/*************************************************************************/ + +/** + * This method returns the fully qualified name of the type, excluding any + * array dimension information or brackets. + * + * @return The fully qualified type name, sans array information or brackets. + */ +public abstract String +qualifiedTypeName(); + +/*************************************************************************/ + +/** + * This method returns the array dimensions as brackets. + * + * @param The array dimensions. + */ +public abstract String +dimension(); + +/*************************************************************************/ + +/** + * This method returns the unqualfied name of the type, and includes array + * dimension information. + * + * @return The unqualified name of the type, including array dimension info. + */ +public abstract String +toString(); + +/*************************************************************************/ + +/** + * This method returns this type as a <code>ClassDoc</object>. This is not + * a valid operation for primitive types. + * + * @return A <code>ClassDoc</code> for this type, or <code>null</code> if + * this is a primitive type. + */ +public abstract ClassDoc +asClassDoc(); + +/** + * This method returns whether this type represents one of the + * built-in Java primitive types. + */ +public abstract boolean +isPrimitive(); + +/** + * Returns this type as a <code>TypeVariable</code>, if it is an + * instance of the <code>TypeVariable</code> class. Otherwise, + * it returns null. + * + * @return this cast to a <code>TypeVariable</code> instance, or null + * if this is not a type variable. + */ +TypeVariable +asTypeVariable(); + +} // interface Type + diff --git a/tools/com/sun/javadoc/TypeVariable.java b/tools/com/sun/javadoc/TypeVariable.java new file mode 100644 index 000000000..4f847d26b --- /dev/null +++ b/tools/com/sun/javadoc/TypeVariable.java @@ -0,0 +1,73 @@ +/* TypeVariable.java -- Document a Java type variable. + Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.javadoc; + +/** + * This class represents a type variable, which is used to parameterize + * the types used in a method or class. For example, + * <code>List<E></code> has the type variable, <code>E</code>. Type + * variables may have explicit bounds, such as <code><T extends + * Book></code>, which specifies that the type is a sub-class of + * <code>Book</code>. + * + * @since 1.5 + * @author Andrew John Hughes (gnu_andrew@member.fsf.org) + */ +public interface TypeVariable + extends Type +{ + + /** + * Returns the bounds of this type variable. These are the types + * represented in the <code>extends</code> clause. + * + * @return an array of types which specify the bounds of this variable. + * The array is empty if there are no explicit bounds. + */ + Type[] bounds(); + + /** + * Returns the class, interface, method or constructor in which this + * type variable was declared. + * + * @return the owning program element for this type variable. + */ + ProgramElementDoc owner(); + +} diff --git a/tools/com/sun/tools/doclets/Taglet.java b/tools/com/sun/tools/doclets/Taglet.java new file mode 100644 index 000000000..f4f348d67 --- /dev/null +++ b/tools/com/sun/tools/doclets/Taglet.java @@ -0,0 +1,63 @@ +/* com.sun.tools.doclets.Taglet + Copyright (C) 2001 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package com.sun.tools.doclets; + +import com.sun.javadoc.Tag; + +public interface Taglet { + + public String getName(); + + public boolean inConstructor(); + + public boolean inField(); + + public boolean inMethod(); + + public boolean inOverview(); + + public boolean inPackage(); + + public boolean inType(); + + public boolean isInlineTag(); + + public String toString(Tag tag); + + public String toString(Tag[] tagArray); +} diff --git a/tools/com/sun/tools/javac/Main.java b/tools/com/sun/tools/javac/Main.java new file mode 100644 index 000000000..f67a2d728 --- /dev/null +++ b/tools/com/sun/tools/javac/Main.java @@ -0,0 +1,155 @@ +/* Main.java -- implement com.sun.tools.javac.Main + Copyright (C) 2007 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.tools.javac; + +import gnu.classpath.Configuration; +import java.io.File; +import java.io.PrintWriter; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.text.MessageFormat; + +public class Main +{ + static Constructor ecjConstructor = null; + static Method ecjMethod = null; + + static + { + String classname = "org.eclipse.jdt.internal.compiler.batch.Main"; + Class klass = null; + try + { + klass = Class.forName(classname); + } + catch (ClassNotFoundException e) + { + File jar = new File(Configuration.ECJ_JAR); + if (!jar.exists() || !jar.canRead()) + { + String message + = MessageFormat.format(Messages.getString("Main.FailedToRead"), + new Object[] { Configuration.ECJ_JAR }); + System.err.println(message); + } + + ClassLoader loader = null; + try + { + loader = new URLClassLoader(new URL[] {jar.toURL()}); + } + catch (MalformedURLException f) + { + String message + = MessageFormat.format(Messages.getString("Main.MalformedURL"), + new Object[] { Configuration.ECJ_JAR }); + System.err.println(message); + f.printStackTrace(); + } + + try + { + klass = loader.loadClass(classname); + } + catch (ClassNotFoundException g) + { + String message + = MessageFormat.format(Messages.getString("Main.FailedToLoad"), + new Object[] { classname, + Configuration.ECJ_JAR }); + System.err.println(message); + g.printStackTrace(); + } + } + + try + { + ecjConstructor = klass.getConstructor(new Class[] { + PrintWriter.class, + PrintWriter.class, + Boolean.TYPE}); + } + catch (NoSuchMethodException h) + { + System.err.println(Messages.getString("Main.FailedConstructor")); + h.printStackTrace(); + } + + try + { + ecjMethod = klass.getMethod("compile", new Class[] {String[].class}); + } + catch (NoSuchMethodException i) + { + System.err.println(Messages.getString("Main.FailedCompile")); + i.printStackTrace(); + } + } + + public static int compile(String[] args, PrintWriter p) throws Exception + { + /* + * This code depends on the patch in Comment #10 in this bug + * report: + * + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 + */ + Object ecjInstance = ecjConstructor.newInstance(new Object[] + { + p, + new PrintWriter(System.err), + Boolean.FALSE + }); + return ((Boolean) ecjMethod.invoke(ecjInstance, new Object[] + { args })).booleanValue() ? 0 : -1; + } + + public static int compile(String[] args) throws Exception + { + return compile(args, new PrintWriter(System.out)); + } + + public static void main(String[] args) throws Exception + { + Runtime.getRuntime().exit(Main.compile(args)); + } +} diff --git a/tools/com/sun/tools/javac/Messages.java b/tools/com/sun/tools/javac/Messages.java new file mode 100644 index 000000000..17f22ac44 --- /dev/null +++ b/tools/com/sun/tools/javac/Messages.java @@ -0,0 +1,67 @@ +/* Messages.java -- localization support for com.sun.tools.javac + Copyright (C) 2007 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package com.sun.tools.javac; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +public class Messages +{ + private static final String BUNDLE_NAME + = "com.sun.tools.javac.messages"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE + = ResourceBundle.getBundle(BUNDLE_NAME); + + private Messages() + { + } + + public static String getString(String key) + { + try + { + return RESOURCE_BUNDLE.getString(key); + } + catch (MissingResourceException e) + { + return '!' + key + '!'; + } + } +} diff --git a/tools/sun/rmi/rmic/Main.java b/tools/sun/rmi/rmic/Main.java new file mode 100644 index 000000000..7acc65696 --- /dev/null +++ b/tools/sun/rmi/rmic/Main.java @@ -0,0 +1,60 @@ +/* Main.java -- implement sun.rmi.rmic.Main + Copyright (C) 2007 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package sun.rmi.rmic; + +import java.io.OutputStream; + +public class Main +{ + // Ant calls this. What to do with stream and string? + public Main(OutputStream stream, String string) {} + + public boolean compile(String[] args) + { + try + { + gnu.classpath.tools.rmic.Main.main(args); + } + catch (Exception e) + { + System.err.println(Messages.getString("Main.InternalError")); + e.printStackTrace(); + } + return true; + } +} diff --git a/tools/sun/rmi/rmic/Messages.java b/tools/sun/rmi/rmic/Messages.java new file mode 100644 index 000000000..80f5513a8 --- /dev/null +++ b/tools/sun/rmi/rmic/Messages.java @@ -0,0 +1,67 @@ +/* Messages.java -- localization support for sun.rmi.rmic + Copyright (C) 2007 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package sun.rmi.rmic; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +public class Messages +{ + private static final String BUNDLE_NAME + = "sun.rmi.rmic.messages"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE + = ResourceBundle.getBundle(BUNDLE_NAME); + + private Messages() + { + } + + public static String getString(String key) + { + try + { + return RESOURCE_BUNDLE.getString(key); + } + catch (MissingResourceException e) + { + return '!' + key + '!'; + } + } +} |