gpt4 book ai didi

org.apache.xmlrpc.parser.XmlRpcRequestParser.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 18:03:05 39 4
gpt4 key购买 nike

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

XmlRpcRequestParser.<init>介绍

[英]Creates a new instance, which parses a clients request.
[中]创建一个新实例,解析客户端请求。

代码示例

代码示例来源:origin: apache/ofbiz-framework

protected XmlRpcRequest getRequest(final XmlRpcStreamRequestConfig pConfig, InputStream pStream)
    throws XmlRpcException {
  final XmlRpcRequestParser parser = new XmlRpcRequestParser(pConfig, getTypeFactory());
  final XMLReader xr = SAXParsers.newXMLReader();
  xr.setContentHandler(parser);
  try {
    xr.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
    xr.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
    xr.setFeature("http://xml.org/sax/features/external-general-entities", false);
    xr.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
    xr.parse(new InputSource(pStream));
  } catch (SAXException | IOException e) {
    throw new XmlRpcException("Failed to parse / read XML-RPC request: " + e.getMessage(), e);
  }
  final List<?> params = parser.getParams();
  return new XmlRpcRequest() {
    public XmlRpcRequestConfig getConfig() {
      return pConfig;
    }
    public String getMethodName() {
      return parser.getMethodName();
    }
    public int getParameterCount() {
      return params == null ? 0 : params.size();
    }
    public Object getParameter(int pIndex) {
      return params.get(pIndex);
    }
  };
}

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

protected XmlRpcRequest getRequest(final XmlRpcStreamRequestConfig pConfig,
                  InputStream pStream) throws XmlRpcException {
  final XmlRpcRequestParser parser = new XmlRpcRequestParser(pConfig, getTypeFactory());
  final XMLReader xr = SAXParsers.newXMLReader();
  xr.setContentHandler(parser);
  try {
    xr.parse(new InputSource(pStream));
  } catch (SAXException e) {
    Exception ex = e.getException();
    if (ex != null  &&  ex instanceof XmlRpcException) {
      throw (XmlRpcException) ex;
    }
    throw new XmlRpcException("Failed to parse XML-RPC request: " + e.getMessage(), e);
  } catch (IOException e) {
    throw new XmlRpcException("Failed to read XML-RPC request: " + e.getMessage(), e);
  }
  final List params = parser.getParams();
  return new XmlRpcRequest(){
    public XmlRpcRequestConfig getConfig() { return pConfig; }
    public String getMethodName() { return parser.getMethodName(); }
    public int getParameterCount() { return params == null ? 0 : params.size(); }
    public Object getParameter(int pIndex) { return params.get(pIndex); }
  };
}

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

protected XmlRpcRequest getRequest(final XmlRpcStreamRequestConfig pConfig,
                  InputStream pStream) throws XmlRpcException {
  final XmlRpcRequestParser parser = new XmlRpcRequestParser(pConfig, getTypeFactory());
  final XMLReader xr = SAXParsers.newXMLReader();
  xr.setContentHandler(parser);
  try {
    xr.parse(new InputSource(pStream));
  } catch (SAXException e) {
    Exception ex = e.getException();
    if (ex != null  &&  ex instanceof XmlRpcException) {
      throw (XmlRpcException) ex;
    }
    throw new XmlRpcException("Failed to parse XML-RPC request: " + e.getMessage(), e);
  } catch (IOException e) {
    throw new XmlRpcException("Failed to read XML-RPC request: " + e.getMessage(), e);
  }
  final List params = parser.getParams();
  return new XmlRpcRequest(){
    public XmlRpcRequestConfig getConfig() { return pConfig; }
    public String getMethodName() { return parser.getMethodName(); }
    public int getParameterCount() { return params == null ? 0 : params.size(); }
    public Object getParameter(int pIndex) { return params.get(pIndex); }
  };
}

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

protected XmlRpcRequest getRequest(final XmlRpcStreamRequestConfig pConfig,
                  InputStream pStream) throws XmlRpcException {
  final XmlRpcRequestParser parser = new XmlRpcRequestParser(pConfig, getTypeFactory());
  final XMLReader xr = SAXParsers.newXMLReader();
  xr.setContentHandler(parser);
  try {
    xr.parse(new InputSource(pStream));
  } catch (SAXException e) {
    Exception ex = e.getException();
    if (ex != null  &&  ex instanceof XmlRpcException) {
      throw (XmlRpcException) ex;
    }
    throw new XmlRpcException("Failed to parse XML-RPC request: " + e.getMessage(), e);
  } catch (IOException e) {
    throw new XmlRpcException("Failed to read XML-RPC request: " + e.getMessage(), e);
  }
  final List params = parser.getParams();
  return new XmlRpcRequest(){
    public XmlRpcRequestConfig getConfig() { return pConfig; }
    public String getMethodName() { return parser.getMethodName(); }
    public int getParameterCount() { return params == null ? 0 : params.size(); }
    public Object getParameter(int pIndex) { return params.get(pIndex); }
  };
}

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com