org.apache.xmlrpc.serializer.XmlRpcWriter.writeValue()方法的使用及代码示例

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

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

XmlRpcWriter.writeValue介绍

[英]Writes the XML representation of a Java object.
[中]编写Java对象的XML表示形式。

代码示例

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-common

/** Writes a servers response to the output stream.
 * @param pConfig The request configuration.
 * @param pResult The result object.
 * @throws SAXException Writing the response failed.
 */
public void write(XmlRpcRequestConfig pConfig, Object pResult) throws SAXException {
  handler.startDocument();
  boolean extensions = pConfig.isEnabledForExtensions();
  if (extensions) {
    handler.startPrefixMapping("ex", XmlRpcWriter.EXTENSIONS_URI);
  }
  handler.startElement("", "methodResponse", "methodResponse", ZERO_ATTRIBUTES);
  handler.startElement("", "params", "params", ZERO_ATTRIBUTES);
  handler.startElement("", "param", "param", ZERO_ATTRIBUTES);
  writeValue(pResult);
  handler.endElement("", "param", "param");
  handler.endElement("", "params", "params");
  handler.endElement("", "methodResponse", "methodResponse");
  if (extensions) {
    handler.endPrefixMapping("ex");
  }
  handler.endDocument();
}

代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-common

/** Writes a servers response to the output stream.
 * @param pConfig The request configuration.
 * @param pResult The result object.
 * @throws SAXException Writing the response failed.
 */
public void write(XmlRpcRequestConfig pConfig, Object pResult) throws SAXException {
  handler.startDocument();
  boolean extensions = pConfig.isEnabledForExtensions();
  if (extensions) {
    handler.startPrefixMapping("ex", XmlRpcWriter.EXTENSIONS_URI);
  }
  handler.startElement("", "methodResponse", "methodResponse", ZERO_ATTRIBUTES);
  handler.startElement("", "params", "params", ZERO_ATTRIBUTES);
  handler.startElement("", "param", "param", ZERO_ATTRIBUTES);
  writeValue(pResult);
  handler.endElement("", "param", "param");
  handler.endElement("", "params", "params");
  handler.endElement("", "methodResponse", "methodResponse");
  if (extensions) {
    handler.endPrefixMapping("ex");
  }
  handler.endDocument();
}

代码示例来源:origin: rosjava/rosjava_core

/** Writes a servers response to the output stream.
 * @param pConfig The request configuration.
 * @param pResult The result object.
 * @throws SAXException Writing the response failed.
 */
public void write(XmlRpcRequestConfig pConfig, Object pResult) throws SAXException {
  handler.startDocument();
  boolean extensions = pConfig.isEnabledForExtensions();
  if (extensions) {
    handler.startPrefixMapping("ex", XmlRpcWriter.EXTENSIONS_URI);
  }
  handler.startElement("", "methodResponse", "methodResponse", ZERO_ATTRIBUTES);
  handler.startElement("", "params", "params", ZERO_ATTRIBUTES);
  handler.startElement("", "param", "param", ZERO_ATTRIBUTES);
  writeValue(pResult);
  handler.endElement("", "param", "param");
  handler.endElement("", "params", "params");
  handler.endElement("", "methodResponse", "methodResponse");
  if (extensions) {
    handler.endPrefixMapping("ex");
  }
  handler.endDocument();
}

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-common

writeValue(map);
handler.endElement("", "fault", "fault");
handler.endElement("", "methodResponse", "methodResponse");

代码示例来源:origin: rosjava/rosjava_core

writeValue(map);
handler.endElement("", "fault", "fault");
handler.endElement("", "methodResponse", "methodResponse");

代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-common

writeValue(map);
handler.endElement("", "fault", "fault");
handler.endElement("", "methodResponse", "methodResponse");

代码示例来源:origin: rosjava/rosjava_core

/** Writes a clients request to the output stream.
 * @param pRequest The request being written.
 * @throws SAXException Writing the request failed.
 */
public void write(XmlRpcRequest pRequest) throws SAXException {
  handler.startDocument();
  boolean extensions = pRequest.getConfig().isEnabledForExtensions();
  if (extensions) {
    handler.startPrefixMapping("ex", XmlRpcWriter.EXTENSIONS_URI);
  }
  handler.startElement("", "methodCall", "methodCall", ZERO_ATTRIBUTES);
  handler.startElement("", "methodName", "methodName", ZERO_ATTRIBUTES);
  String s = pRequest.getMethodName();
  handler.characters(s.toCharArray(), 0, s.length());
  handler.endElement("", "methodName", "methodName");
  handler.startElement("", "params", "params", ZERO_ATTRIBUTES);
  int num = pRequest.getParameterCount();
  for (int i = 0;  i < num;  i++) {
    handler.startElement("", "param", "param", ZERO_ATTRIBUTES);
    writeValue(pRequest.getParameter(i));
    handler.endElement("", "param", "param");
  }
  handler.endElement("", "params", "params");
  handler.endElement("", "methodCall", "methodCall");
  if (extensions) {
    handler.endPrefixMapping("ex");
  }
  handler.endDocument();
}

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-common

/** Writes a clients request to the output stream.
 * @param pRequest The request being written.
 * @throws SAXException Writing the request failed.
 */
public void write(XmlRpcRequest pRequest) throws SAXException {
  handler.startDocument();
  boolean extensions = pRequest.getConfig().isEnabledForExtensions();
  if (extensions) {
    handler.startPrefixMapping("ex", XmlRpcWriter.EXTENSIONS_URI);
  }
  handler.startElement("", "methodCall", "methodCall", ZERO_ATTRIBUTES);
  handler.startElement("", "methodName", "methodName", ZERO_ATTRIBUTES);
  String s = pRequest.getMethodName();
  handler.characters(s.toCharArray(), 0, s.length());
  handler.endElement("", "methodName", "methodName");
  handler.startElement("", "params", "params", ZERO_ATTRIBUTES);
  int num = pRequest.getParameterCount();
  for (int i = 0;  i < num;  i++) {
    handler.startElement("", "param", "param", ZERO_ATTRIBUTES);
    writeValue(pRequest.getParameter(i));
    handler.endElement("", "param", "param");
  }
  handler.endElement("", "params", "params");
  handler.endElement("", "methodCall", "methodCall");
  if (extensions) {
    handler.endPrefixMapping("ex");
  }
  handler.endDocument();
}

代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-common

/** Writes a clients request to the output stream.
 * @param pRequest The request being written.
 * @throws SAXException Writing the request failed.
 */
public void write(XmlRpcRequest pRequest) throws SAXException {
  handler.startDocument();
  boolean extensions = pRequest.getConfig().isEnabledForExtensions();
  if (extensions) {
    handler.startPrefixMapping("ex", XmlRpcWriter.EXTENSIONS_URI);
  }
  handler.startElement("", "methodCall", "methodCall", ZERO_ATTRIBUTES);
  handler.startElement("", "methodName", "methodName", ZERO_ATTRIBUTES);
  String s = pRequest.getMethodName();
  handler.characters(s.toCharArray(), 0, s.length());
  handler.endElement("", "methodName", "methodName");
  handler.startElement("", "params", "params", ZERO_ATTRIBUTES);
  int num = pRequest.getParameterCount();
  for (int i = 0;  i < num;  i++) {
    handler.startElement("", "param", "param", ZERO_ATTRIBUTES);
    writeValue(pRequest.getParameter(i));
    handler.endElement("", "param", "param");
  }
  handler.endElement("", "params", "params");
  handler.endElement("", "methodCall", "methodCall");
  if (extensions) {
    handler.endPrefixMapping("ex");
  }
  handler.endDocument();
}

相关文章