mil.dod.th.confluence.doclet/src/org/udri/doclet/confluence/ConfluenceDoclet.java
private static void writeExecutableMember(PrintWriter pw, ExecutableMemberDoc member,
            boolean isOverride) {

        StringBuilder memberStr = new StringBuilder();
        
        // Add intra-document link
        // The current class could be a parent class or interface, so always get
        // the current class.
        //Also, it looks like links are capped at 40 characters. Methods are the most
        //likely culprit, so let's just put it here for now.  --jkg 1/5/2012
        String link = CURRENT_CLASSDOC.name() + member.name();
        if (link.length() > LINK_MAX_LEN)
        {
            link = link.substring(0,LINK_MAX_LEN);
        }
        _docLinks.add(link);
        memberStr.append("h4. ").append(member.name());
        memberStr.append("\n" + getVisibility(member)).append(" ");

        if (member.isFinal()) {
            memberStr.append("final ");
        }
        if (member.isStatic()) {
            memberStr.append("static ");
        }
        if (member.isSynchronized()) {
            memberStr.append("synchronized ");
        }
        if (member.isSynthetic()) {
            memberStr.append("synthetic ");
        }
        if (member.isInterface()) {
            memberStr.append("interface ");
        }
        if (member.isMethod()) {
            MethodDoc method = (MethodDoc) member;

            if (method.isAbstract()) {
                memberStr.append("abstract ");
            }

            memberStr.append(
                    generateGenericTypeInfo(method.returnType(), false))
                    .append(" ");
        }

        memberStr.append(member.name()).append("(");

        // For each parameter, write it out, taking into account
        // a possible variable length argument as the last param.
        if (member.parameters().length > 0) {
            int i = 0;
            int len = member.parameters().length;
            for (Parameter param : member.parameters()) {
                i++;
                memberStr
                        .append(generateGenericTypeInfo(param.type(),
                                member.isVarArgs() && (i == len))).append(" ")
                        .append(param.name());
                if (i < len) {
                    memberStr.append(", ");
                }
            }
        }
        
        memberStr.append("\\)");
        // If the method marked with the inherit tag, don't do these guys.
        boolean isInherited = false;
        for (Tag tag : member.inlineTags()) {
            if (tag.name().indexOf(Tags.INHERITDOC.getName()) > -1) {
                isInherited = true;
                break;
            }
        }

        pw.println(htmlToWiki(memberStr.toString()));

        if (isOverride) {
            writeMethodOverrideComment(pw, (MethodDoc) member);
        } else {
            writeComment(pw, member);
        }

        writeTags(pw, member);
        
        if (!isInherited && !isOverride) {
            writeParameters(pw, member.parameters(), member);

            Tag[] returnTags = member.tags("@return");
            if (returnTags.length > 0) {
                StringBuilder returnStr = new StringBuilder();
                returnStr.append("*Returns:* ");
                
                returnStr.append(getTagComment(returnTags[0]));

                pw.println(htmlToWiki(returnStr.toString()));
            }

            writeExceptions(pw, member);
        }
    }
/**
     * Write out Ctor or Method doc element, adding documentation for overridden
     * methods.
     */
Write out Ctor or Method doc element, adding documentation for overridden
methods.
Write out Ctor or Method doc element adding documentation for overridden methods .
private static void writeExecutableMember(PrintWriter pw, ExecutableMemberDoc member,
            boolean isOverride) {
        StringBuilder memberStr = new StringBuilder();
        String link = CURRENT_CLASSDOC.name() + member.name();
        if (link.length() > LINK_MAX_LEN)
        {
            link = link.substring(0,LINK_MAX_LEN);
        }
        _docLinks.add(link);
        memberStr.append("h4. ").append(member.name());
        memberStr.append("\n" + getVisibility(member)).append(" ");
        if (member.isFinal()) {
            memberStr.append("final ");
        }
        if (member.isStatic()) {
            memberStr.append("static ");
        }
        if (member.isSynchronized()) {
            memberStr.append("synchronized ");
        }
        if (member.isSynthetic()) {
            memberStr.append("synthetic ");
        }
        if (member.isInterface()) {
            memberStr.append("interface ");
        }
        if (member.isMethod()) {
            MethodDoc method = (MethodDoc) member;
            if (method.isAbstract()) {
                memberStr.append("abstract ");
            }
            memberStr.append(
                    generateGenericTypeInfo(method.returnType(), false))
                    .append(" ");
        }
        memberStr.append(member.name()).append("(");
        if (member.parameters().length > 0) {
            int i = 0;
            int len = member.parameters().length;
            for (Parameter param : member.parameters()) {
                i++;
                memberStr
                        .append(generateGenericTypeInfo(param.type(),
                                member.isVarArgs() && (i == len))).append(" ")
                        .append(param.name());
                if (i < len) {
                    memberStr.append(", ");
                }
            }
        }
        memberStr.append("\\)");
        boolean isInherited = false;
        for (Tag tag : member.inlineTags()) {
            if (tag.name().indexOf(Tags.INHERITDOC.getName()) > -1) {
                isInherited = true;
                break;
            }
        }
        pw.println(htmlToWiki(memberStr.toString()));
        if (isOverride) {
            writeMethodOverrideComment(pw, (MethodDoc) member);
        } else {
            writeComment(pw, member);
        }
        writeTags(pw, member);
        if (!isInherited && !isOverride) {
            writeParameters(pw, member.parameters(), member);
            Tag[] returnTags = member.tags("@return");
            if (returnTags.length > 0) {
                StringBuilder returnStr = new StringBuilder();
                returnStr.append("*Returns:* ");
                returnStr.append(getTagComment(returnTags[0]));
                pw.println(htmlToWiki(returnStr.toString()));
            }
            writeExceptions(pw, member);
        }
    }
private static void writeExecutableMember ( PrintWriter pw , ExecutableMemberDoc member , boolean isOverride ) { StringBuilder memberStr = new StringBuilder ( ) ; String link = CURRENT_CLASSDOC . name ( ) + member . name ( ) ; if ( link . length ( ) > LINK_MAX_LEN ) { link = link . substring ( 0 , LINK_MAX_LEN ) ; } _docLinks . add ( link ) ; memberStr . append ( "h4. " ) . append ( member . name ( ) ) ; memberStr . append ( "\n" + getVisibility ( member ) ) . append ( " " ) ; if ( member . isFinal ( ) ) { memberStr . append ( "final " ) ; } if ( member . isStatic ( ) ) { memberStr . append ( "static " ) ; } if ( member . isSynchronized ( ) ) { memberStr . append ( "synchronized " ) ; } if ( member . isSynthetic ( ) ) { memberStr . append ( "synthetic " ) ; } if ( member . isInterface ( ) ) { memberStr . append ( "interface " ) ; } if ( member . isMethod ( ) ) { MethodDoc method = ( MethodDoc ) member ; if ( method . isAbstract ( ) ) { memberStr . append ( "abstract " ) ; } memberStr . append ( generateGenericTypeInfo ( method . returnType ( ) , false ) ) . append ( " " ) ; } memberStr . append ( member . name ( ) ) . append ( "(" ) ; if ( member . parameters ( ) . length > 0 ) { int i = 0 ; int len = member . parameters ( ) . length ; for ( Parameter param : member . parameters ( ) ) { i ++ ; memberStr . append ( generateGenericTypeInfo ( param . type ( ) , member . isVarArgs ( ) && ( i == len ) ) ) . append ( " " ) . append ( param . name ( ) ) ; if ( i < len ) { memberStr . append ( ", " ) ; } } } memberStr . append ( "\\)" ) ; boolean isInherited = false ; for ( Tag tag : member . inlineTags ( ) ) { if ( tag . name ( ) . indexOf ( Tags . INHERITDOC . getName ( ) ) > - 1 ) { isInherited = true ; break ; } } pw . println ( htmlToWiki ( memberStr . toString ( ) ) ) ; if ( isOverride ) { writeMethodOverrideComment ( pw , ( MethodDoc ) member ) ; } else { writeComment ( pw , member ) ; } writeTags ( pw , member ) ; if ( ! isInherited && ! isOverride ) { writeParameters ( pw , member . parameters ( ) , member ) ; Tag [ ] returnTags = member . tags ( "@return" ) ; if ( returnTags . length > 0 ) { StringBuilder returnStr = new StringBuilder ( ) ; returnStr . append ( "*Returns:* " ) ; returnStr . append ( getTagComment ( returnTags [ 0 ] ) ) ; pw . println ( htmlToWiki ( returnStr . toString ( ) ) ) ; } writeExceptions ( pw , member ) ; } }
Write out Ctor or Method doc element, adding documentation for overridden
 methods.
Write out Ctor or Method doc element adding documentation for overridden methods .
// Add intra-document link // The current class could be a parent class or interface, so always get // the current class. //Also, it looks like links are capped at 40 characters. Methods are the most //likely culprit, so let's just put it here for now.  --jkg 1/5/2012 // For each parameter, write it out, taking into account // a possible variable length argument as the last param. // If the method marked with the inherit tag, don't do these guys.