[jdom-interest] setChildren(List)

philip.nelson at omniresources.com philip.nelson at omniresources.com
Mon Jun 25 06:38:50 PDT 2001

another minor cleanup issue.  First of all, why do we have setChildren when
all it does is delegate to setMixedContent?

If there is a reason, the documentation is out of sync between the two.  The
setMixedContent documentation is correct I believe:

     * <p>
     * This sets the content of the element.  The passed in List should
     * contain only objects of type <code>String</code>,
     * <code>Comment</code>, <code>ProcessingInstruction</code>, 
     * <code>CDATA</code>, and <code>EntityRef</code>.  Passing a null or
     * empty List clears the existing content.  In event of an exception 
     * the original content will be unchanged and the items in the added
     * content will be unaltered.

but here is setChildren

     * <p>
     * This sets the content of the element to be the List of 
     * <code>Element</code> objects within the supplied <code>List</code>.
     * All existing element and non-element content of the element is
     * In event of an exception the children may be partially added.
     * </p>
     * @param children <code>List</code> of <code>Element</code> objects to
     * @return this element modified
    public Element setChildren(List children) {
        return setMixedContent(children);

More information about the jdom-interest mailing list