Example usage for org.dom4j.tree DefaultCDATA DefaultCDATA

List of usage examples for org.dom4j.tree DefaultCDATA DefaultCDATA

Introduction

In this page you can find the example usage for org.dom4j.tree DefaultCDATA DefaultCDATA.

Prototype

public DefaultCDATA(String text) 

Source Link

Document

DOCUMENT ME!

Usage

From source file:org.projectforge.framework.xstream.XmlObjectWriter.java

License:Open Source License

private void writeValue(final Branch branch, final Object obj, final String key, final String sValue,
        final boolean asAttribute, final boolean asCDATA) {
    if (sValue == null) {
        return;/*from   w  w  w .  ja  v a2  s .  c  o m*/
    }
    if (asAttribute == true) {
        addAttribute((Element) branch, obj, key, sValue);
    } else if (asCDATA == true) {
        branch.addElement(key).add(new DefaultCDATA(sValue));
    } else {
        branch.addElement(key).setText(sValue);
    }
}