mil.dod.th.confluence.doclet/src/org/udri/doclet/confluence/ConfluenceDoclet.java
private static void writeFields(PrintWriter pw, FieldDoc[] fields) {
        
        // First sort static methods
        List<FieldDoc> sortedStaticFields = new ArrayList<FieldDoc>();
        for (FieldDoc field : fields) {
            if (!field.isStatic())
                continue;
            for (int j = 0; j < sortedStaticFields.size(); j++) {
                if (field.name().charAt(0) < sortedStaticFields.get(j).name()
                        .charAt(0)) {
                    sortedStaticFields.add(j, field);
                    break;
                }
            }
            if (!sortedStaticFields.contains(field))
                sortedStaticFields.add(field);
        }
        // Next sort the other fields
        List<FieldDoc> sortedFields = new ArrayList<FieldDoc>();
        for (FieldDoc field : fields) {
            if (field.isStatic())
                continue;
            for (int j = 0; j < sortedFields.size(); j++) {
                if (field.name().charAt(0) < sortedFields.get(j).name()
                        .charAt(0)) {
                    if (field.isStatic())
                        sortedFields.add(j, field);
                    break;
                }
            }
            if (!sortedFields.contains(field))
                sortedFields.add(field);
        }

        // Combine the lists, putting static methods first
        sortedFields.addAll(0, sortedStaticFields);

        if (sortedFields.size() > 0)
        {
            pw.println("{panel}");
            pw.println("h3. Fields");
            pw.println("{panel}");
            pw.println(LINE);
        }
        
        // Iterate over the fields
        for (FieldDoc field : sortedFields) {
            if (!isPublicOrProtected(field)) {
                continue;
            }

            writeField(pw, field);
            pw.println(LINE);
        }
    }
/**
     * Write out Fields for a given Class
     */
Write out Fields for a given Class
Write out Fields for a given Class
private static void writeFields(PrintWriter pw, FieldDoc[] fields) {
        List<FieldDoc> sortedStaticFields = new ArrayList<FieldDoc>();
        for (FieldDoc field : fields) {
            if (!field.isStatic())
                continue;
            for (int j = 0; j < sortedStaticFields.size(); j++) {
                if (field.name().charAt(0) < sortedStaticFields.get(j).name()
                        .charAt(0)) {
                    sortedStaticFields.add(j, field);
                    break;
                }
            }
            if (!sortedStaticFields.contains(field))
                sortedStaticFields.add(field);
        }
        List<FieldDoc> sortedFields = new ArrayList<FieldDoc>();
        for (FieldDoc field : fields) {
            if (field.isStatic())
                continue;
            for (int j = 0; j < sortedFields.size(); j++) {
                if (field.name().charAt(0) < sortedFields.get(j).name()
                        .charAt(0)) {
                    if (field.isStatic())
                        sortedFields.add(j, field);
                    break;
                }
            }
            if (!sortedFields.contains(field))
                sortedFields.add(field);
        }
        sortedFields.addAll(0, sortedStaticFields);
        if (sortedFields.size() > 0)
        {
            pw.println("{panel}");
            pw.println("h3. Fields");
            pw.println("{panel}");
            pw.println(LINE);
        }
        for (FieldDoc field : sortedFields) {
            if (!isPublicOrProtected(field)) {
                continue;
            }
            writeField(pw, field);
            pw.println(LINE);
        }
    }
private static void writeFields ( PrintWriter pw , FieldDoc [ ] fields ) { List < FieldDoc > sortedStaticFields = new ArrayList < FieldDoc > ( ) ; for ( FieldDoc field : fields ) { if ( ! field . isStatic ( ) ) continue ; for ( int j = 0 ; j < sortedStaticFields . size ( ) ; j ++ ) { if ( field . name ( ) . charAt ( 0 ) < sortedStaticFields . get ( j ) . name ( ) . charAt ( 0 ) ) { sortedStaticFields . add ( j , field ) ; break ; } } if ( ! sortedStaticFields . contains ( field ) ) sortedStaticFields . add ( field ) ; } List < FieldDoc > sortedFields = new ArrayList < FieldDoc > ( ) ; for ( FieldDoc field : fields ) { if ( field . isStatic ( ) ) continue ; for ( int j = 0 ; j < sortedFields . size ( ) ; j ++ ) { if ( field . name ( ) . charAt ( 0 ) < sortedFields . get ( j ) . name ( ) . charAt ( 0 ) ) { if ( field . isStatic ( ) ) sortedFields . add ( j , field ) ; break ; } } if ( ! sortedFields . contains ( field ) ) sortedFields . add ( field ) ; } sortedFields . addAll ( 0 , sortedStaticFields ) ; if ( sortedFields . size ( ) > 0 ) { pw . println ( "{panel}" ) ; pw . println ( "h3. Fields" ) ; pw . println ( "{panel}" ) ; pw . println ( LINE ) ; } for ( FieldDoc field : sortedFields ) { if ( ! isPublicOrProtected ( field ) ) { continue ; } writeField ( pw , field ) ; pw . println ( LINE ) ; } }
Write out Fields for a given Class
Write out Fields for a given Class
// First sort static methods // Next sort the other fields // Combine the lists, putting static methods first // Iterate over the fields