Java XMLStreamWriter writeColorConfig(XMLStreamWriter writer, Boolean enabled, String error, String warn, String success, String required, String batch)

Here you can find the source of writeColorConfig(XMLStreamWriter writer, Boolean enabled, String error, String warn, String success, String required, String batch)

Description

write Color Config

License

Open Source License

Declaration

protected static void writeColorConfig(XMLStreamWriter writer, Boolean enabled, String error, String warn,
            String success, String required, String batch) throws XMLStreamException 

Method Source Code


//package com.java2s;

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

public class Main {
    protected static void writeColorConfig(XMLStreamWriter writer, Boolean enabled, String error, String warn,
            String success, String required, String batch) throws XMLStreamException {
        writer.writeStartElement("color-output");
        writer.writeStartElement("enabled");
        writer.writeCharacters(enabled.toString());
        writer.writeEndElement(); // enabled

        if (!"".equals(error)) {
            writer.writeStartElement("error-color");
            writer.writeCharacters(error);
            writer.writeEndElement();//  w  ww  .  j  a v a2 s  . c om
        }

        if (!"".equals(warn)) {
            writer.writeStartElement("warn-color");
            writer.writeCharacters(warn);
            writer.writeEndElement();
        }

        if (!"".equals(success)) {
            writer.writeStartElement("success-color");
            writer.writeCharacters(success);
            writer.writeEndElement();
        }

        if (!"".equals(required)) {
            writer.writeStartElement("required-color");
            writer.writeCharacters(required);
            writer.writeEndElement();
        }

        if (!"".equals(batch)) {
            writer.writeStartElement("workflow-color");
            writer.writeCharacters(batch);
            writer.writeEndElement();
        }

        writer.writeEndElement(); //color-output
    }
}

Related

  1. renderPath(XMLStreamWriter writer, String pathData, String id, String style)
  2. serializeEndpart(XMLStreamWriter writer)
  3. setValueType(XMLStreamWriter xml, String dataType)
  4. writeAttribute(XMLStreamWriter out, QName name, String value)
  5. writeCharactersOrCDATA(XMLStreamWriter xsw, String string)
  6. writeComment(String comment, XMLStreamWriter xmlsw)
  7. writeEndElement(XMLStreamWriter out, QName name)
  8. writeFloat(String name, float value, XMLStreamWriter writer)
  9. writeFooter(XMLStreamWriter w)