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

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

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

XMLUtilities.cleanupXML介绍

[英]Properly escapes all illegal characters inside the XML String
[中]正确地转义XML字符串中的所有非法字符

代码示例

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

/**
 * 
 * @param data
 * @return
 */
protected long getDataSize(String data)
{
  long dataSize = 0;
      
  dataSize = XMLUtilities.cleanupXML(data).length();
          
  return dataSize;
}

代码示例来源:origin: org.openmobster.core/device-agent-simulator

private String marshalId(String id)
{
  String xml = null;
  
  StringBuffer buffer = new StringBuffer();	
  
  buffer.append("<mobileObject>\n");		
  buffer.append("<recordId>"+XMLUtilities.cleanupXML(id)+"</recordId>\n");		
  buffer.append("</mobileObject>\n");
  
  xml = buffer.toString();
  
  return xml;
}

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

public String marshalId(String recordId) throws SyncException
{
  StringBuffer buffer = new StringBuffer();
  recordId = mapEngine.mapFromServerToLocal(recordId);
  String id = XMLUtilities.cleanupXML(recordId);
  
  buffer.append("<mobileObject>\n");
  buffer.append("<recordId>"+id+"</recordId>\n");
  buffer.append("</mobileObject>\n");
  
  return buffer.toString();
}    
//------------------------------------------------------------------------------------------------

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

/**
 * 
 * @param anchor
 * @return
 */
public String generateAnchor(Anchor anchor)
{
  String xml = null;
  
  StringBuffer buffer = new StringBuffer();
  
  buffer.append("<"+SyncXMLTags.Anchor+" xmlns='"+SyncXMLTags.sycml_metinf+"'>\n");
  buffer.append("<"+SyncXMLTags.Last+">"+XMLUtilities.cleanupXML(anchor.getLastSync())+"</"+SyncXMLTags.Last+">\n");
  buffer.append("<"+SyncXMLTags.Next+">"+XMLUtilities.cleanupXML(anchor.getNextSync())+"</"+SyncXMLTags.Next+">\n");
  buffer.append("</"+SyncXMLTags.Anchor+">\n");
  
  xml = buffer.toString();
  
  return xml;
}
//-----------------------------------------------------------------------------------------------------------

代码示例来源:origin: org.openmobster.core/device-agent-simulator

/**
 * 
 * @param anchor
 * @return
 */
public String generateAnchor(Anchor anchor)
{
  String xml = null;
  
  StringBuffer buffer = new StringBuffer();
  
  buffer.append("<"+SyncXMLTags.Anchor+" xmlns='"+SyncXMLTags.sycml_metinf+"'>\n");
  buffer.append("<"+SyncXMLTags.Last+">"+XMLUtilities.cleanupXML(anchor.getLastSync())+"</"+SyncXMLTags.Last+">\n");
  buffer.append("<"+SyncXMLTags.Next+">"+XMLUtilities.cleanupXML(anchor.getNextSync())+"</"+SyncXMLTags.Next+">\n");
  buffer.append("</"+SyncXMLTags.Anchor+">\n");
  
  xml = buffer.toString();
  
  return xml;
}
//-----------------------------------------------------------------------------------------------------------

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

buffer.append("<"+VALUE+">"+XMLUtilities.cleanupXML(field.value)+"</"+VALUE+">\n");
buffer.append("</"+FIELD+">\n");

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

buffer.append("<"+SyncXMLTags.CmdID+">"+XMLUtilities.cleanupXML(recordMap.getCmdId())+"</"+SyncXMLTags.CmdID+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(recordMap.getSource()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Source+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(recordMap.getTarget()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Target+">\n");
  buffer.append("<"+SyncXMLTags.Meta+">"+XMLUtilities.cleanupXML(recordMap.getMeta())+"</"+SyncXMLTags.Meta+">\n");
  buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(mapItem.getSource()));
  buffer.append("</"+SyncXMLTags.LocURI+">\n");
  buffer.append("</"+SyncXMLTags.Source+">\n");
  buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(mapItem.getTarget()));
  buffer.append("</"+SyncXMLTags.LocURI+">\n");
  buffer.append("</"+SyncXMLTags.Target+">\n");

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

/**
 * 
 * @param alerts
 * @return
 */
private String generateAlerts(List alerts)
{
  String xml = null;
  
  StringBuffer buffer = new StringBuffer();
  
  for(int i=0;i<alerts.size();i++)
  {
    Alert alert = (Alert)alerts.get(i);
    
    buffer.append("<"+SyncXMLTags.Alert+">\n");
    
    buffer.append("<"+SyncXMLTags.CmdID+">"+XMLUtilities.cleanupXML(alert.getCmdId())+"</"+SyncXMLTags.CmdID+">\n");
    buffer.append("<"+SyncXMLTags.Data+">"+alert.getData()+"</"+SyncXMLTags.Data+">\n");
    
    buffer.append(this.generateItems(alert.getItems()));
          
    buffer.append("</"+SyncXMLTags.Alert+">\n");
  }
  
  xml = buffer.toString();
  
  return xml;
}

代码示例来源:origin: org.openmobster.core/device-agent-simulator

/**
 * 
 * @param alerts
 * @return
 */
private String generateAlerts(Vector alerts)
{
  String xml = null;
  
  StringBuffer buffer = new StringBuffer();
  
  for(int i=0,size=alerts.size();i<size;i++)
  {
    Alert alert = (Alert)alerts.elementAt(i);
    
    buffer.append("<"+SyncXMLTags.Alert+">\n");
    
    buffer.append("<"+SyncXMLTags.CmdID+">"+XMLUtilities.cleanupXML(alert.getCmdId())+"</"+SyncXMLTags.CmdID+">\n");
    buffer.append("<"+SyncXMLTags.Data+">"+alert.getData()+"</"+SyncXMLTags.Data+">\n");
    
    buffer.append(this.generateItems(alert.getItems()));
          
    buffer.append("</"+SyncXMLTags.Alert+">\n");
  }
  
  xml = buffer.toString();
  
  return xml;
}

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

buffer.append(XMLUtilities.cleanupXML(deviceRecordId));
buffer.append("</recordId>\n");
buffer.append(XMLUtilities.cleanupXML(serverRecordId));
buffer.append("</serverRecordId>\n");
buffer.append(XMLUtilities.cleanupXML(deviceRecordId));
buffer.append("</recordId>\n");
buffer.append(XMLUtilities.cleanupXML(serverRecordId));
buffer.append("</serverRecordId>\n");

代码示例来源:origin: org.openmobster.core/device-agent-simulator

buffer.append("<"+SyncXMLTags.CmdID+">"+XMLUtilities.cleanupXML(recordMap.getCmdId())+"</"+SyncXMLTags.CmdID+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(recordMap.getSource()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Source+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(recordMap.getTarget()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Target+">\n");
  buffer.append("<"+SyncXMLTags.Meta+">"+XMLUtilities.cleanupXML(recordMap.getMeta())+"</"+SyncXMLTags.Meta+">\n");
  buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(mapItem.getSource()));
  buffer.append("</"+SyncXMLTags.LocURI+">\n");
  buffer.append("</"+SyncXMLTags.Source+">\n");
  buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(mapItem.getTarget()));
  buffer.append("</"+SyncXMLTags.LocURI+">\n");
  buffer.append("</"+SyncXMLTags.Target+">\n");

代码示例来源:origin: org.openmobster.core/device-agent-simulator

buffer.append("<"+SyncXMLTags.CmdID+">"+XMLUtilities.cleanupXML(cour.getCmdId())+"</"+SyncXMLTags.CmdID+">\n");
buffer.append("<"+SyncXMLTags.Data+">"+cour.getData()+"</"+SyncXMLTags.Data+">\n");
buffer.append("<"+SyncXMLTags.MsgRef+">"+cour.getMsgRef()+"</"+SyncXMLTags.MsgRef+">\n");

代码示例来源:origin: org.openmobster.core/device-agent-frameworks

xmlBuffer.append("<recordId>"+XMLUtilities.cleanupXML(mobileObject.getRecordId())+"</recordId>\n");
xmlBuffer.append("<serverRecordId>"+XMLUtilities.cleanupXML(mobileObject.getServerRecordId())+"</serverRecordId>\n");
xmlBuffer.append("<object>\n");
    xmlBuffer.append("<uri>"+field.getUri()+"</uri>\n");
    xmlBuffer.append("<name>"+field.getName()+"</name>\n");
    xmlBuffer.append("<value>"+XMLUtilities.cleanupXML(field.getValue())+"</value>\n");
    xmlBuffer.append("</field>\n");

代码示例来源:origin: org.openmobster.core/device-agent-simulator

buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(item.getSource()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Source+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(item.getTarget()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Target+">\n");
buffer.append("<"+SyncXMLTags.Meta+">"+XMLUtilities.cleanupXML(item.getMeta())+"</"+SyncXMLTags.Meta+">\n");

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

buffer.append("<"+SyncXMLTags.VerDTD+">"+"1.1"+"</"+SyncXMLTags.VerDTD+">\n");
buffer.append("<"+SyncXMLTags.VerProto+">"+"SyncML/1.1"+"</"+SyncXMLTags.VerProto+">\n");
buffer.append("<"+SyncXMLTags.SessionID+">"+XMLUtilities.cleanupXML(session.getSessionId())+"</"+SyncXMLTags.SessionID+">\n");
buffer.append("<"+SyncXMLTags.App+">"+XMLUtilities.cleanupXML(session.getApp())+"</"+SyncXMLTags.App+">\n");
buffer.append("<"+SyncXMLTags.Source+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(session.getSource()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Source+">\n");
buffer.append("<"+SyncXMLTags.Target+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(session.getTarget()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Target+">\n");
buffer.append("<"+SyncXMLTags.MsgID+">"+XMLUtilities.cleanupXML(syncMessage.getMessageId())+"</"+SyncXMLTags.MsgID+">\n");
if(syncMessage.isClientInitiated())

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

buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(item.getSource()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Source+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(item.getTarget()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Target+">\n");
buffer.append("<"+SyncXMLTags.Meta+">"+XMLUtilities.cleanupXML(item.getMeta())+"</"+SyncXMLTags.Meta+">\n");

代码示例来源:origin: org.openmobster.core/device-agent-simulator

buffer.append("<"+SyncXMLTags.VerDTD+">"+"1.1"+"</"+SyncXMLTags.VerDTD+">\n");
buffer.append("<"+SyncXMLTags.VerProto+">"+"SyncML/1.1"+"</"+SyncXMLTags.VerProto+">\n");
buffer.append("<"+SyncXMLTags.SessionID+">"+XMLUtilities.cleanupXML(session.getSessionId())+"</"+SyncXMLTags.SessionID+">\n");
buffer.append("<"+SyncXMLTags.App+">"+XMLUtilities.cleanupXML(session.getApp())+"</"+SyncXMLTags.App+">\n");
buffer.append("<"+SyncXMLTags.Source+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(session.getSource()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Source+">\n");
buffer.append("<"+SyncXMLTags.Target+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(session.getTarget()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Target+">\n");
buffer.append("<"+SyncXMLTags.MsgID+">"+XMLUtilities.cleanupXML(syncMessage.getMessageId())+"</"+SyncXMLTags.MsgID+">\n");
if(syncMessage.isClientInitiated())

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

buffer.append("<"+SyncXMLTags.VerDTD+">"+"1.1"+"</"+SyncXMLTags.VerDTD+">\n");
buffer.append("<"+SyncXMLTags.VerProto+">"+"SyncML/1.1"+"</"+SyncXMLTags.VerProto+">\n");
buffer.append("<"+SyncXMLTags.SessionID+">"+XMLUtilities.cleanupXML(session.getSessionId())+"</"+SyncXMLTags.SessionID+">\n");
buffer.append("<"+SyncXMLTags.App+">"+XMLUtilities.cleanupXML(session.getApp())+"</"+SyncXMLTags.App+">\n");
buffer.append("<"+SyncXMLTags.Source+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(session.getSource()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Source+">\n");
buffer.append("<"+SyncXMLTags.Target+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(session.getTarget()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Target+">\n");
buffer.append("<"+SyncXMLTags.MsgID+">"+XMLUtilities.cleanupXML(syncMessage.getMessageId())+"</"+SyncXMLTags.MsgID+">\n");
if(syncMessage.isClientInitiated())

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

buffer.append("<"+SyncXMLTags.CmdID+">"+XMLUtilities.cleanupXML(cour.getCmdId())+"</"+SyncXMLTags.CmdID+">\n");
buffer.append("<"+SyncXMLTags.Data+">"+cour.getData()+"</"+SyncXMLTags.Data+">\n");
buffer.append("<"+SyncXMLTags.MsgRef+">"+cour.getMsgRef()+"</"+SyncXMLTags.MsgRef+">\n");

代码示例来源:origin: org.openmobster.core/device-agent-simulator

buffer.append("<"+SyncXMLTags.VerDTD+">"+"1.1"+"</"+SyncXMLTags.VerDTD+">\n");
buffer.append("<"+SyncXMLTags.VerProto+">"+"SyncML/1.1"+"</"+SyncXMLTags.VerProto+">\n");
buffer.append("<"+SyncXMLTags.SessionID+">"+XMLUtilities.cleanupXML(session.getSessionId())+"</"+SyncXMLTags.SessionID+">\n");	
buffer.append("<"+SyncXMLTags.App+">"+XMLUtilities.cleanupXML(session.getApp())+"</"+SyncXMLTags.App+">\n");
buffer.append("<"+SyncXMLTags.Source+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(session.getSource()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Source+">\n");
buffer.append("<"+SyncXMLTags.Target+">\n");
buffer.append("<"+SyncXMLTags.LocURI+">"+XMLUtilities.cleanupXML(session.getTarget()));
buffer.append("</"+SyncXMLTags.LocURI+">\n");
buffer.append("</"+SyncXMLTags.Target+">\n");
buffer.append("<"+SyncXMLTags.MsgID+">"+XMLUtilities.cleanupXML(syncMessage.getMessageId())+"</"+SyncXMLTags.MsgID+">\n");
if(syncMessage.isClientInitiated())

相关文章