本文整理汇总了Java中org.hamster.weixinmp.dao.entity.resp.WxRespImageEntity类的典型用法代码示例。如果您正苦于以下问题:Java WxRespImageEntity类的具体用法?Java WxRespImageEntity怎么用?Java WxRespImageEntity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WxRespImageEntity类属于org.hamster.weixinmp.dao.entity.resp包,在下文中一共展示了WxRespImageEntity类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseRespXML
import org.hamster.weixinmp.dao.entity.resp.WxRespImageEntity; //导入依赖的package包/类
public Element parseRespXML(WxBaseRespEntity resp) throws DocumentException {
WxMsgRespTypeEnum type = WxMsgRespTypeEnum.inst(resp.getMsgType());
switch (type) {
case IMAGE:
return WxXmlUtil.getRespImage((WxRespImageEntity) resp);
case MUSIC:
return WxXmlUtil.getRespMusic((WxRespMusicEntity) resp, ((WxRespMusicEntity) resp).getThumb());
case NEWS:
return WxXmlUtil.getRespPicDesc((WxRespPicDescEntity) resp);
case TEXT:
return WxXmlUtil.getRespTextXML((WxRespTextEntity) resp);
case VIDEO:
return WxXmlUtil.getRespVideo((WxRespVideoEntity) resp);
case VOICE:
return WxXmlUtil.getRespVoice((WxRespVoiceEntity) resp);
default:
break;
}
return null;
}
示例2: getRespImage
import org.hamster.weixinmp.dao.entity.resp.WxRespImageEntity; //导入依赖的package包/类
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[fromUser]]></FromUserName><br />
* <CreateTime>12345678</CreateTime><br />
* <MsgType><![CDATA[image]]></MsgType><br />
* <Image><br />
* <MediaId><![CDATA[media_id]]></MediaId><br />
* </Image><br />
* </xml><br />
* </code>
*
* @param respImage
* @return
* @throws DocumentException
*/
public static Element getRespImage(WxRespImageEntity respImage) throws DocumentException {
Element ele = respEntityFactory(respImage);
Element imageEle = ele.addElement("Image");
imageEle.addElement("MediaId").addCDATA(respImage.getImage().getMediaId());
return ele;
}