Java Utililty Methods XMLStreamWriter

List of utility methods to do XMLStreamWriter

Description

The list of methods to do XMLStreamWriter are organized into topic(s).

Method

voidaddObjectId(final XMLStreamWriter writer, final String objId)
Adds the provided object id to the XMLStreamWriter that has been provided.
The object id is added as the attribute "objid".
writer.writeAttribute("objid", objId);
XMLStreamWriterCloseNewHTML(XMLStreamWriter serializer)
Close New HTML
serializer.writeEndElement(); 
serializer.writeEndElement(); 
serializer.writeEndDocument();
return serializer;
voidcloseQuietly(XMLStreamWriter c)
close Quietly
if (c == null)
    return;
try {
    c.close();
} catch (XMLStreamException ignore) {
voidcopy(Reader reader, XMLStreamWriter xmlStreamWriter)
copy
XMLStreamReader xmlStreamReader = XMLInputFactory.newFactory().createXMLStreamReader(reader);
copy(xmlStreamReader, xmlStreamWriter);
xmlStreamReader.close();
XMLStreamWriterCreateColumn(XMLStreamWriter serializer, String w, String h)
Create Column
serializer.writeStartElement("td");
if (w != "")
    serializer.writeAttribute("width", w);
if (h != "")
    serializer.writeAttribute("height", h);
return serializer;
XMLStreamWriterCreateSimpleImage(XMLStreamWriter serializer, URL url, int w, int h)
Create Simple Image
serializer.writeStartElement("img");
serializer.writeAttribute("src", url.toString());
if (w != 0)
    serializer.writeAttribute("width", String.valueOf(w));
if (h != 0)
    serializer.writeAttribute("height", String.valueOf(h));
return serializer;
XMLStreamWriterCreateSimpleTagAndContent(XMLStreamWriter serializer, String tag, String content)
Create Simple Tag And Content
return CreateSimpleTagAndContent(serializer, tag, content, true);
XMLStreamWriterCreateTable(XMLStreamWriter serializer)
Create Table
return CreateTable(serializer, "", "");
XMLStreamWritercreateXMLStreamWriter(StringWriter outWriter)
Returns a XMLStreamWriter with the specified StringWriter.
return xmlOutputFactory.createXMLStreamWriter(outWriter);
voidexportCoordinateList(XMLStreamWriter writer, List coordinates, String separator)
export Coordinate List
if (coordinates != null && !coordinates.isEmpty()) {
    String sep = separator;
    if (separator == null || "".equals(separator)) {
        sep = " ";
    int size = coordinates.size();
    StringBuilder sb = new StringBuilder(size);
    for (int i = 0; i < size; ++i) {
...