cp-tools-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cp-tools-discuss] RFC: [gjdoc] Addition of class-level type variable su


From: Andrew John Hughes
Subject: [Cp-tools-discuss] RFC: [gjdoc] Addition of class-level type variable support.
Date: Sun, 17 Apr 2005 14:59:53 +0100

The attached patch adds support to gjdoc for type variables at the
class-level (e.g. List<E>, Pair<A,B>).  Without this patch, it fails
with a NullPointerException (as it attempts to find a return type for
the constructor, which isn't recognised as such due to the mismatch
between its name and the unparsed class name).

I'd like some comments before I commit this, especially as I'm new to
this code base.  This only fixes the HTML doclet, so any suggestions on
how to expand this to the others would also be appreciated.

Changelog:
2005-04-17  Andrew John Hughes  <address@hidden>

        * src/com/sun/javadoc/ClassDoc.java:
        (typeParameters()): New method for retrieving type variables.
        * src/com/sun/javadoc/Type.java:
        (asTypeVariable()): New method for casting to a type variable.
        * src/com/sun/javadoc/TypeVariable.java:
        New class to handle type variables.
        (bounds()): New method to retrieve variable bounds.
        (owner()): New method to retrieve owning class.
        * src/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java:
        (printIndexEntry(HtmlPage,Doc)): Add type variables to class
name.
        (printClassPage(File,String,ClassDoc,ClassDoc,ClassDoc)):
        Likewise.
        (createTypeHref(HtmlPage,Type,boolean)): Likewise.
        (getTypeParameters(ClassDoc)): New method to construct a String
        containing the type parameters.
        * src/gnu/classpath/tools/gjdoc/ClassDocImpl.java:
        (asTypeVariable()): New method.

(createInstance(ClassDoc,PackageDoc,ClassDoc[],PackageDoc[],char[],
        int,int,List)): Add parsing of type variables, which may contain
','.
        (typeParameters()): New method to return the type parameters.
        (parseTypeVariables(ClassDocImpl, String)): New method to parse
        the type variables.
        * src/gnu/classpath/tools/gjdoc/ClassDocProxy.java:
        (asTypeVariable()): New method.
        (typeParameters()): New method.
        * src/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.java:
        (asTypeVariable()): New method.
        (typeParameters()): New method.
        * src/gnu/classpath/tools/gjdoc/TypeImpl.java:
        (asTypeVariable()): New variable to cast type variables.
        * src/gnu/classpath/tools/gjdoc/TypeImpl.java:
        (asTypeVariable()): New variable to cast type variables.
        * src/gnu/classpath/tools/gjdoc/TypeVariableImpl.java:
        New class to represent type variables.
        (TypeVariableImpl(String,String,String,ProgramElementDoc)):
        New constructor, which also handles owning class.
        (setBounds(List)): New method to set bounds.
        (bounds()): New method to retrieve bounds.
        (owner()): New method to retrieve owner.

Thanks,
-- 
Andrew :-)

Please avoid sending me Microsoft Office (e.g. Word, PowerPoint)
attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html

No software patents in Europe -- http://nosoftwarepatents.com

"Value your freedom, or you will lose it, teaches history.
`Don't bother us with politics' respond those who don't want to learn."
-- Richard Stallman

Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
public class gcj extends Freedom implements Java { ... }

Attachment: gjdoc-01-typevars.diff
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]