FileDocCategorySizeDatePackage
HomeJDOM.javaAPI DocExample655Sun Sep 02 14:59:04 BST 2001com.oreilly.forum.xml

HomeJDOM.java

package com.oreilly.forum.xml;

import com.oreilly.forum.domain.*;
import java.util.*;
import org.jdom.*;

/**
 * Produce JDOM data for the home page.
 */
public class HomeJDOM {

    /**
     * @param boards an iterator of <code>BoardSummary</code> objects.
     */
    public static Element produceElement(Iterator boards) {
        Element homeElem = new Element("home");
        while (boards.hasNext()) {
            BoardSummary curBoard = (BoardSummary) boards.next();
            homeElem.addContent(BoardSummaryJDOM.produceElement(curBoard));
        }

        return homeElem;
    }

    private HomeJDOM() {
    }
}