org.openmobster.core.common.XMLUtilities.marshal()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中org.openmobster.core.common.XMLUtilities.marshal()方法的一些代码示例,展示了XMLUtilities.marshal()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLUtilities.marshal()方法的具体详情如下:
包路径:org.openmobster.core.common.XMLUtilities
类名称:XMLUtilities
方法名:marshal

XMLUtilities.marshal介绍

[英]Serializes the specified Object into an XML representation
[中]将指定的对象序列化为XML表示形式

代码示例

代码示例来源:origin: org.openmobster.core/dataService

  1. private String prepareServiceResponse(Response beanResponse)
  2. {
  3. Map<String, String> responseAttributes = new HashMap<String, String>();
  4. if(beanResponse != null)
  5. {
  6. String[] cour = beanResponse.getNames();
  7. if(cour != null)
  8. {
  9. for(String name: cour)
  10. {
  11. responseAttributes.put(name, beanResponse.getAttribute(name));
  12. }
  13. }
  14. }
  15. return XMLUtilities.marshal(responseAttributes);
  16. }
  17. }

代码示例来源:origin: org.openmobster.core/push-apn

  1. encode(notification.getMetaDataAsString(Constants.message),"UTF-8"));
  2. Map<String,String> extras = (Map<String,String>)notification.getMetaData(Constants.extras);
  3. String extrasStr = XMLUtilities.marshal(extras);
  4. commandBuilder.append(Constants.separator+Constants.extras+"="+URLEncoder.encode(extrasStr,"UTF-8"));

代码示例来源:origin: org.openmobster.core/services

  1. private void sendChannelEvent(List<ChannelBeanMetaData> allUpdates)
  2. {
  3. String channel = this.channelRegistration.getUri();
  4. BusMessage message = new BusMessage();
  5. message.setBusUri(channel);
  6. message.setSenderUri(channel);
  7. ChannelEvent event = new ChannelEvent();
  8. event.setChannel(channel);
  9. event.setAttribute(ChannelEvent.metadata, allUpdates);
  10. message.setAttribute(ChannelEvent.event, XMLUtilities.marshal(event));
  11. Bus.sendMessage(message);
  12. }
  13. }

代码示例来源:origin: org.openmobster.core/common

  1. String busMessageXml = XMLUtilities.marshal(busMessage);

相关文章