• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java XmlRpcStreamConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.xmlrpc.common.XmlRpcStreamConfig的典型用法代码示例。如果您正苦于以下问题:Java XmlRpcStreamConfig类的具体用法?Java XmlRpcStreamConfig怎么用?Java XmlRpcStreamConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XmlRpcStreamConfig类属于org.apache.xmlrpc.common包,在下文中一共展示了XmlRpcStreamConfig类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: writeRequest

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
public void writeRequest(XmlRpcStreamConfig config, XmlRpcRequest request) throws SAXException {
    handler.startDocument();
    boolean extensions = config.isEnabledForExtensions();
    if (extensions) {
        handler.startPrefixMapping("ex", org.apache.xmlrpc.serializer.XmlRpcWriter.EXTENSIONS_URI);
    }
    handler.startElement("", "methodCall", "methodCall", ZERO_ATTRIBUTES);
    handler.startElement("", "methodName", "methodName", ZERO_ATTRIBUTES);
    String s = request.getMethodName();
    handler.characters(s.toCharArray(), 0, s.length());
    handler.endElement("", "methodName", "methodName");
    handler.startElement("", "params", "params", ZERO_ATTRIBUTES);
    int num = request.getParameterCount();
    for (int i = 0; i < num; i++) {
        handler.startElement("", "param", "param", ZERO_ATTRIBUTES);
        writeValue(request.getParameter(i));
        handler.endElement("", "param", "param");
    }
    handler.endElement("", "params", "params");
    handler.endElement("", "methodCall", "methodCall");
    if (extensions) {
        handler.endPrefixMapping("ex");
    }
    handler.endDocument();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:26,代码来源:XmlRpcWriter.java


示例2: getParser

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
@Override
public TypeParser getParser(XmlRpcStreamConfig pConfig, NamespaceContextImpl pContext, String pURI, String pLocalName) {
    TypeParser defaultParser = super.getParser(pConfig, pContext, pURI, pLocalName);
    if (defaultParser instanceof I4Parser) {
        return new TolerantI4Parser();
    } else if (defaultParser instanceof DateParser) {
        return new TolerantDateParser(new XmlRpcDateTimeDateFormat(){
            private static final long serialVersionUID = 7585237706442299067L;
            protected TimeZone getTimeZone() {
                return getController().getConfig().getTimeZone();
            }
        });
    } else {
        return defaultParser;
    }
}
 
开发者ID:vmware,项目名称:workflowTools,代码行数:17,代码来源:TolerantTypeFactory.java


示例3: getSerializer

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
/**
 * Correctly handle outgoing requests containing XML-RPC "None" values.
 */
@Override
public TypeSerializer getSerializer(XmlRpcStreamConfig pConfig, Object pObject) throws SAXException {
    if (pObject == null) {
        return new TypeSerializerImpl() {
            public void write(ContentHandler pHandler, Object o) throws SAXException {
                pHandler.startElement("", VALUE_TAG, VALUE_TAG, ZERO_ATTRIBUTES);
                pHandler.startElement("", NullSerializer.NIL_TAG, NullSerializer.NIL_TAG, ZERO_ATTRIBUTES);
                pHandler.endElement("", NullSerializer.NIL_TAG, NullSerializer.NIL_TAG);
                pHandler.endElement("", VALUE_TAG, VALUE_TAG);
            }
        };
    } else {
        return super.getSerializer(pConfig, pObject);
    }
}
 
开发者ID:vtunka,项目名称:jenkins-koji-plugin,代码行数:19,代码来源:MyTypeFactory.java


示例4: getSerializer

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
/**
 * Serializer.
 */
@Override
public TypeSerializer getSerializer(XmlRpcStreamConfig pConfig, Object pObject) throws SAXException
{
	if (pObject instanceof Date)
	{
		return new DateSerializer(newFormat());
	}
	return super.getSerializer(pConfig, pObject);
}
 
开发者ID:unistra,项目名称:fsp,代码行数:13,代码来源:XmlRpc.java


示例5: getParser

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
@Override
public TypeParser getParser(XmlRpcStreamConfig pConfig, NamespaceContextImpl pContext, String pURI, String pLocalName) {
  if (DoubleSerializer.DOUBLE_TAG.equals(pLocalName)) {
    return new AnalysisRpcDoubleParser();
  }
  return super.getParser(pConfig, pContext, pURI, pLocalName);
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:8,代码来源:AnalysisRpcTypeFactoryImpl.java


示例6: getParser

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
/**
 * Correctly handle XML-RPC "None" elements in incoming responses from server.
 */
@Override
public TypeParser getParser(XmlRpcStreamConfig pConfig,
                            NamespaceContextImpl pContext, String pURI, String pLocalName) {

    if ("".equals(pURI) && NullSerializer.NIL_TAG.equals(pLocalName)) {
        return new NullParser();
    } else {
        return super.getParser(pConfig, pContext, pURI, pLocalName);
    }
}
 
开发者ID:vtunka,项目名称:jenkins-koji-plugin,代码行数:14,代码来源:MyTypeFactory.java


示例7: getParser

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public TypeParser getParser(XmlRpcStreamConfig pConfig, NamespaceContextImpl pContext, String pURI,
	String pLocalName) {
	if (EObjectSerializer.EOBJECT_TAG.equals(pLocalName)) {
		return new EObjectTypeParser();
	} else {
		return super.getParser(pConfig, pContext, pURI, pLocalName);
	}
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:13,代码来源:EObjectTypeFactory.java


示例8: getSerializer

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public TypeSerializer getSerializer(XmlRpcStreamConfig pConfig, Object pObject) throws SAXException {
	if (pObject instanceof EObject) {
		return new EObjectSerializer();
	} else {
		return super.getSerializer(pConfig, pObject);
	}
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:12,代码来源:EObjectTypeFactory.java


示例9: getParser

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
/**
 * Date parser.
 */
@Override
public TypeParser getParser(XmlRpcStreamConfig pConfig, NamespaceContextImpl pContext, String pURI, String pLocalName)
{
	if (DateSerializer.DATE_TAG.equals(pLocalName))
	{
		return new DateParser(newFormat());
	}
	return super.getParser(pConfig, pContext, pURI, pLocalName);
}
 
开发者ID:unistra,项目名称:fsp,代码行数:13,代码来源:XmlRpc.java


示例10: getParser

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
@Override
public TypeParser getParser(XmlRpcStreamConfig pConfig,
        NamespaceContextImpl pContext, String pURI, String pLocalName) {
    if ("".equals(pURI) && NullSerializer.NIL_TAG.equals(pLocalName)) {
        return new NullParser();
    } else if ("i8".equals(pLocalName)) {
        return new LongTypeParser();
    } else {
        return super.getParser(pConfig, pContext, pURI, pLocalName);
    }
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:12,代码来源:RpcTypeFactory.java


示例11: getSerializer

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
public TypeSerializer getSerializer(XmlRpcStreamConfig pConfig,
        Object pObject) throws SAXException {
    if (pObject instanceof Long) {
        return new LongTypeSerializer();
    } else {
        return super.getSerializer(pConfig, pObject);
    }
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:9,代码来源:RpcTypeFactory.java


示例12: callTimeoutInSec

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
@Override
public Object callTimeoutInSec(String method, List<?> params, int timeout,
        boolean debug) throws XmlRpcException {
    XmlRpcStreamConfig config = new XmlRpcHttpRequestConfigImpl();
    XmlRpcClient client = new XmlRpcClient();
    client.setTypeFactory(new RpcTypeFactory(client));
    XmlRpcResponseParser parser = new XmlRpcResponseParser(
            (XmlRpcStreamRequestConfig) config, client.getTypeFactory());
    XMLReader xr = SAXParsers.newXMLReader();
    xr.setContentHandler(parser);
    try {
        String result = null;
        if (getMethodResponse(method) != null) {
            result = getMethodResponse(method);
            LOGGER.debug("methodresponse call: " + method + " - " + params);
            LOGGER.trace("methodresponse reply: " + result);
        }
        if (result == null && multiRes.size() >= 0) {
            result = getResult();
            LOGGER.debug("getresult call: " + method + " - " + params);
            LOGGER.trace("getresult reply: " + result);
        }
        xr.parse(new InputSource(new StringReader(result)));
    } catch (Exception e) {
        throw new XmlRpcException("Exception: " + e.getMessage(), e);
    }
    if (parser.getErrorCode() != 0) {
        throw new XmlRpcException("Fault received[" + parser.getErrorCode()
                + "]: " + parser.getErrorMessage());
    }
    return parser.getResult();
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:33,代码来源:ConnectionTest.java


示例13: getSerializer

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
@Override
public TypeSerializer getSerializer(XmlRpcStreamConfig pConfig, Object pObject) throws SAXException {
  if (pObject instanceof Double) {
    return new DoubleSerializer();
  } else if (pObject instanceof Integer) {
    return new IntegerSerializer();
  } else {
    return super.getSerializer(pConfig, pObject);
  }
}
 
开发者ID:skimarxall,项目名称:asyncsubtitles,代码行数:11,代码来源:TypeFactory.java


示例14: XmlRpcWriter

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
public XmlRpcWriter(XmlRpcStreamConfig pConfig, ContentHandler pHandler, TypeFactory pTypeFactory) {
    super(pConfig, pHandler, pTypeFactory);
    handler = pHandler;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:XmlRpcWriter.java



注:本文中的org.apache.xmlrpc.common.XmlRpcStreamConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BasicControl类代码示例发布时间:2022-05-23
下一篇:
Java MIMEMessage类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap