Search in sources :

Example 6 with XStream

use of com.thoughtworks.xstream.XStream in project weixin-java-tools by chanjarster.

the class XStreamTransformer method config_WxCpXmlMessage.

private static XStream config_WxCpXmlMessage() {
    XStream xstream = XStreamInitializer.getInstance();
    xstream.processAnnotations(WxCpXmlMessage.class);
    xstream.processAnnotations(WxCpXmlMessage.ScanCodeInfo.class);
    xstream.processAnnotations(WxCpXmlMessage.SendPicsInfo.class);
    xstream.processAnnotations(WxCpXmlMessage.SendPicsInfo.Item.class);
    xstream.processAnnotations(WxCpXmlMessage.SendLocationInfo.class);
    return xstream;
}
Also used : XStream(com.thoughtworks.xstream.XStream)

Example 7 with XStream

use of com.thoughtworks.xstream.XStream in project weixin-java-tools by chanjarster.

the class XStreamTransformer method config_WxMpXmlOutVoiceMessage.

private static XStream config_WxMpXmlOutVoiceMessage() {
    XStream xstream = XStreamInitializer.getInstance();
    xstream.processAnnotations(WxMpXmlOutMessage.class);
    xstream.processAnnotations(WxMpXmlOutVoiceMessage.class);
    return xstream;
}
Also used : XStream(com.thoughtworks.xstream.XStream)

Example 8 with XStream

use of com.thoughtworks.xstream.XStream in project weixin-java-tools by chanjarster.

the class XStreamTransformer method config_WxMpXmlOutVideoMessage.

private static XStream config_WxMpXmlOutVideoMessage() {
    XStream xstream = XStreamInitializer.getInstance();
    xstream.processAnnotations(WxMpXmlOutMessage.class);
    xstream.processAnnotations(WxMpXmlOutVideoMessage.class);
    xstream.processAnnotations(WxMpXmlOutVideoMessage.Video.class);
    return xstream;
}
Also used : XStream(com.thoughtworks.xstream.XStream)

Example 9 with XStream

use of com.thoughtworks.xstream.XStream in project weixin-java-tools by chanjarster.

the class ApiTestModule method fromXml.

public static <T> T fromXml(Class<T> clazz, InputStream is) {
    XStream xstream = XStreamInitializer.getInstance();
    xstream.alias("xml", clazz);
    xstream.processAnnotations(clazz);
    return (T) xstream.fromXML(is);
}
Also used : XStream(com.thoughtworks.xstream.XStream)

Example 10 with XStream

use of com.thoughtworks.xstream.XStream in project weixin-java-tools by chanjarster.

the class XStreamTransformer method config_WxMpXmlOutImageMessage.

private static XStream config_WxMpXmlOutImageMessage() {
    XStream xstream = XStreamInitializer.getInstance();
    xstream.processAnnotations(WxMpXmlOutMessage.class);
    xstream.processAnnotations(WxMpXmlOutImageMessage.class);
    return xstream;
}
Also used : XStream(com.thoughtworks.xstream.XStream)

Aggregations

XStream (com.thoughtworks.xstream.XStream)183 Test (org.junit.Test)54 IOException (java.io.IOException)31 InputStream (java.io.InputStream)28 WstxDriver (com.thoughtworks.xstream.io.xml.WstxDriver)22 Metacard (ddf.catalog.data.Metacard)21 DomDriver (com.thoughtworks.xstream.io.xml.DomDriver)16 HashMap (java.util.HashMap)14 ByteArrayInputStream (java.io.ByteArrayInputStream)12 Matchers.anyString (org.mockito.Matchers.anyString)11 HierarchicalStreamWriter (com.thoughtworks.xstream.io.HierarchicalStreamWriter)10 CswRecordCollection (org.codice.ddf.spatial.ogc.csw.catalog.common.CswRecordCollection)10 GmlGeometryConverter (org.codice.ddf.spatial.ogc.wfs.catalog.converter.impl.GmlGeometryConverter)8 XStreamException (com.thoughtworks.xstream.XStreamException)7 MarshallingContext (com.thoughtworks.xstream.converters.MarshallingContext)7 StaxDriver (com.thoughtworks.xstream.io.xml.StaxDriver)7 FileNotFoundException (java.io.FileNotFoundException)7 ArrayList (java.util.ArrayList)7 ForbiddenClassException (com.thoughtworks.xstream.security.ForbiddenClassException)6 FileWriter (java.io.FileWriter)6