jimm.datavision
Class ListWriter

java.lang.Object
  extended by jimm.datavision.ListWriter

public class ListWriter
extends java.lang.Object

Writes the element of a list of Writeable objects as XML.

Author:
Jim Menard, jimm@io.com

Constructor Summary
ListWriter()
           
 
Method Summary
static void writeList(XMLWriter out, java.util.Collection list)
          Writes the elements of a list of Writeable objects as XML.
static void writeList(XMLWriter out, java.util.Collection list, java.lang.String name)
          Writes the elements of a list of Writeable objects as XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListWriter

public ListWriter()
Method Detail

writeList

public static void writeList(XMLWriter out,
                             java.util.Collection list)
Writes the elements of a list of Writeable objects as XML. Each object's writeXML method is called.

Parameters:
out - the writer
list - the collection of objects to write

writeList

public static void writeList(XMLWriter out,
                             java.util.Collection list,
                             java.lang.String name)
Writes the elements of a list of Writeable objects as XML. An open tag is written if name is not null, then each object's writeXML method is called, then a closing tag is written if needed. If the list is empty, nothing at all gets written.

Parameters:
out - the writer
list - the collection of objects to write
name - the XML tag name to use; if null, no begin/end element is written