@@ -0,0 +1,1350 @@
+package utils;%0A%0Aimport com.thoughtworks.xstream.XStream;%0Aimport com.thoughtworks.xstream.core.util.QuickWriter;%0Aimport com.thoughtworks.xstream.io.HierarchicalStreamWriter;%0Aimport com.thoughtworks.xstream.io.xml.PrettyPrintWriter;%0Aimport com.thoughtworks.xstream.io.xml.XppDriver;%0A%0Aimport java.io.Writer;%0A%0A/**%0A * Created by sunshine on 5/25/16.%0A */%0Apublic class XStreamFactory %7B%0A    protected static String PREFIX_CDATA = %22%3C!%5BCDATA%5B%22;%0A    protected static String SUFFIX_CDATA = %22%5D%5D%3E%22;%0A%0A    public XStreamFactory() %7B%0A    %7D%0A%0A    public static XStream init(boolean isAddCDATA) %7B%0A        XStream xstream = null;%0A        if (isAddCDATA) %7B%0A            xstream = new XStream(new XppDriver() %7B%0A                public HierarchicalStreamWriter createWriter(final Writer out) %7B%0A                    return new PrettyPrintWriter(out) %7B%0A                        protected void writeText(QuickWriter writer, String text) %7B%0A                            if (!text.startsWith(XStreamFactory.PREFIX_CDATA)) %7B%0A                                text = XStreamFactory.PREFIX_CDATA + text + XStreamFactory.SUFFIX_CDATA;%0A                            %7D%0A                            writer.write(text);%0A                        %7D%0A                    %7D;%0A                %7D%0A            %7D);%0A        %7D else %7B%0A            xstream = new XStream();%0A        %7D%0A%0A        return xstream;%0A    %7D%0A%7D

add xstream factory