Java XMLStreamWriter CreateSimpleTagAndContent(XMLStreamWriter serializer, String tag, String content)

Here you can find the source of CreateSimpleTagAndContent(XMLStreamWriter serializer, String tag, String content)

Description

Create Simple Tag And Content

License

Open Source License

Declaration

public static XMLStreamWriter CreateSimpleTagAndContent(XMLStreamWriter serializer, String tag, String content)
            throws XMLStreamException 

Method Source Code

//package com.java2s;
//   Licensed under the Apache License, Version 2.0 (the "License"); you may

import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;

public class Main {
    public static XMLStreamWriter CreateSimpleTagAndContent(XMLStreamWriter serializer, String tag, String content)
            throws XMLStreamException {
        return CreateSimpleTagAndContent(serializer, tag, content, true);
    }/* ww w.ja v  a  2s.co m*/

    public static XMLStreamWriter CreateSimpleTagAndContent(XMLStreamWriter serializer, String tag, String content,
            boolean allow_empty) throws XMLStreamException {
        if (!allow_empty && content.equals(""))
            return serializer;
        serializer.writeStartElement(tag);
        serializer.writeCharacters(content);
        serializer.writeEndElement(); // end simple tag
        return serializer;
    }
}

Related

  1. CloseNewHTML(XMLStreamWriter serializer)
  2. closeQuietly(XMLStreamWriter c)
  3. copy(Reader reader, XMLStreamWriter xmlStreamWriter)
  4. CreateColumn(XMLStreamWriter serializer, String w, String h)
  5. CreateSimpleImage(XMLStreamWriter serializer, URL url, int w, int h)
  6. CreateTable(XMLStreamWriter serializer)
  7. createXMLStreamWriter(StringWriter outWriter)
  8. exportCoordinateList(XMLStreamWriter writer, List coordinates, String separator)
  9. getXMLStreamWriter(final Writer writer)