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

Java XMLStreamBufferResult类代码示例

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

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



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

示例1: readPayload

import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult; //导入依赖的package包/类
@Override
public XMLStreamReader readPayload() throws XMLStreamException {
   try {
        if(infoset==null) {
                            if (rawContext != null) {
                    XMLStreamBufferResult sbr = new XMLStreamBufferResult();
                                    Marshaller m = rawContext.createMarshaller();
                                    m.setProperty("jaxb.fragment", Boolean.TRUE);
                                    m.marshal(jaxbObject, sbr);
                    infoset = sbr.getXMLStreamBuffer();
                            } else {
                                MutableXMLStreamBuffer buffer = new MutableXMLStreamBuffer();
                                writePayloadTo(buffer.createFromXMLStreamWriter());
                                infoset = buffer;
                            }
        }
        XMLStreamReader reader = infoset.readAsXMLStreamReader();
        if(reader.getEventType()== START_DOCUMENT)
            XMLStreamReaderUtil.nextElementContent(reader);
        return reader;
    } catch (JAXBException e) {
       // bug 6449684, spec 4.3.4
       throw new WebServiceException(e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:JAXBMessage.java


示例2: getSchemaOutput

import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult; //导入依赖的package包/类
/**
 * Updates filename if the suggested filename need to be changed in
 * xsd:import. If there is already a schema document for the namespace
 * in the metadata, then it is not generated.
 *
 * return null if schema need not be generated
 *        Result the generated schema document
 */
public Result getSchemaOutput(String namespace, Holder<String> filename) {
    List<SDDocumentImpl> schemas = nsMapping.get(namespace);
    if (schemas != null) {
        if (schemas.size() > 1) {
            throw new ServerRtException("server.rt.err",
                "More than one schema for the target namespace "+namespace);
        }
        filename.value = schemas.get(0).getURL().toExternalForm();
        return null;            // Don't generate schema
    }

    URL url = createURL(filename.value);
    MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
    xsb.setSystemId(url.toExternalForm());
    SDDocumentSource sd = SDDocumentSource.create(url,xsb);
    newDocs.add(sd);

    XMLStreamBufferResult r = new XMLStreamBufferResult(xsb);
    r.setSystemId(filename.value);
    return r;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:WSDLGenResolver.java


示例3: MexEntityResolver

import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult; //导入依赖的package包/类
public MexEntityResolver(List<? extends Source> wsdls) throws IOException {
    Transformer transformer = XmlUtil.newTransformer();
    for (Source source : wsdls) {
        XMLStreamBufferResult xsbr = new XMLStreamBufferResult();
        try {
            transformer.transform(source, xsbr);
        } catch (TransformerException e) {
            throw new WebServiceException(e);
        }
        String systemId = source.getSystemId();

        //TODO: can we do anything if the given mex Source has no systemId?
        if(systemId != null){
            SDDocumentSource doc = SDDocumentSource.create(JAXWSUtils.getFileOrURL(systemId), xsbr.getXMLStreamBuffer());
            this.wsdls.put(systemId, doc);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:MexEntityResolver.java


示例4: buildDocList

import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult; //导入依赖的package包/类
/**
 * Convert metadata sources using identity transform. So that we can
 * reuse the Source object multiple times.
 */
private List<SDDocumentSource> buildDocList() {
    List<SDDocumentSource> r = new ArrayList<>();

    if (metadata != null) {
        for (Source source : metadata) {
            try {
                XMLStreamBufferResult xsbr = XmlUtil.identityTransform(source, new XMLStreamBufferResult());
                String systemId = source.getSystemId();

                r.add(SDDocumentSource.create(new URL(systemId), xsbr.getXMLStreamBuffer()));
            } catch (TransformerException | IOException | SAXException | ParserConfigurationException te) {
                throw new ServerRtException("server.rt.err", te);
            }
        }
    }

    return r;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:EndpointImpl.java


示例5: readPayload

import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult; //导入依赖的package包/类
public XMLStreamReader readPayload() throws XMLStreamException {
   try {
        if(infoset==null) {
            XMLStreamBufferResult sbr = new XMLStreamBufferResult();
            bridge.marshal(jaxbObject,sbr);
            infoset = sbr.getXMLStreamBuffer();
        }
        XMLStreamReader reader = infoset.readAsXMLStreamReader();
        if(reader.getEventType()== START_DOCUMENT)
            XMLStreamReaderUtil.nextElementContent(reader);
        return reader;
    } catch (JAXBException e) {
       // bug 6449684, spec 4.3.4
       throw new WebServiceException(e);
    }
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:17,代码来源:JAXBMessage.java


示例6: WSEndpointReference

import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult; //导入依赖的package包/类
/**
 * Creates from the spec version of {@link EndpointReference}.
 *
 * <p>
 * This method performs the data conversion, so it's slow.
 * Do not use this method in a performance critical path.
 */
public WSEndpointReference(EndpointReference epr, AddressingVersion version) {
    try {
        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
        epr.writeTo(new XMLStreamBufferResult(xsb));
        this.infoset = xsb;
        this.version = version;
        this.rootElement = new QName("EndpointReference", version.nsUri);
        parse();
    } catch (XMLStreamException e) {
        throw new WebServiceException(ClientMessages.FAILED_TO_PARSE_EPR(epr),e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:WSEndpointReference.java


示例7: getWSDL

import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult; //导入依赖的package包/类
/**
 * Generates the concrete WSDL that contains service element.
 *
 * @return Result the generated concrete WSDL
 */
public Result getWSDL(String filename) {
    URL url = createURL(filename);
    MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
    xsb.setSystemId(url.toExternalForm());
    concreteWsdlSource = SDDocumentSource.create(url,xsb);
    newDocs.add(concreteWsdlSource);
    XMLStreamBufferResult r = new XMLStreamBufferResult(xsb);
    r.setSystemId(filename);
    return r;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:WSDLGenResolver.java


示例8: getAbstractWSDL

import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult; //导入依赖的package包/类
/**
 * Updates filename if the suggested filename need to be changed in
 * wsdl:import. If the metadata already contains abstract wsdl(i.e. a WSDL
 * which has the porttype), then the abstract wsdl shouldn't be generated
 *
 * return null if abstract WSDL need not be generated
 *        Result the abstract WSDL
 */
public Result getAbstractWSDL(Holder<String> filename) {
    if (abstractWsdl != null) {
        filename.value = abstractWsdl.getURL().toString();
        return null;                // Don't generate abstract WSDL
    }
    URL url = createURL(filename.value);
    MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
    xsb.setSystemId(url.toExternalForm());
    SDDocumentSource abstractWsdlSource = SDDocumentSource.create(url,xsb);
    newDocs.add(abstractWsdlSource);
    XMLStreamBufferResult r = new XMLStreamBufferResult(xsb);
    r.setSystemId(filename.value);
    return r;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:WSDLGenResolver.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java TTransportException类代码示例发布时间:2022-05-23
下一篇:
Java BasicErrorController类代码示例发布时间: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