Class XMLStreamWriterArrayFilter

  • All Implemented Interfaces:
    XMLStreamWriter

    public class XMLStreamWriterArrayFilter
    extends Object
    implements XMLStreamWriter
    In some cases, we want to marshal an array of objects as a series of elements instead of a single element containing items. Unfortunately there is no way to tell the JAXB marshal method to marshal an array or List as a series of elements. Instead, we use the JAXB marshal method to output a single element with items and then filter the write events to transform it into a series of elements. Thus Hello World Becomes Hello World Special care is taken to ensure that namespace declarations are property preserved.