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

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

本文整理了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

private String prepareServiceResponse(Response beanResponse)
  {
    Map<String, String> responseAttributes = new HashMap<String, String>();
    
    if(beanResponse != null)
    {
      String[] cour = beanResponse.getNames();
      if(cour != null)
      {
        for(String name: cour)
        {
          responseAttributes.put(name, beanResponse.getAttribute(name));
        }
      }
    }
    
    return XMLUtilities.marshal(responseAttributes);
  }
}

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

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

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

private void sendChannelEvent(List<ChannelBeanMetaData> allUpdates)
  {
    String channel = this.channelRegistration.getUri();
    
    BusMessage message = new BusMessage();
    message.setBusUri(channel);
    message.setSenderUri(channel);
                                            
    ChannelEvent event = new ChannelEvent();
    event.setChannel(channel);                    
    event.setAttribute(ChannelEvent.metadata, allUpdates);
    message.setAttribute(ChannelEvent.event, XMLUtilities.marshal(event));
                
    Bus.sendMessage(message);
  }
}

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

String busMessageXml = XMLUtilities.marshal(busMessage);

相关文章