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

Java SAX2DOMEx类代码示例

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

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



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

示例1: ResultImpl

import com.sun.xml.internal.bind.marshaller.SAX2DOMEx; //导入依赖的package包/类
ResultImpl() {
    try {
        DocumentBuilderFactory factory = XmlFactory.createDocumentBuilderFactory(false); // safe - only used for BI
        s2d = new SAX2DOMEx(factory);
    } catch (ParserConfigurationException e) {
        throw new AssertionError(e);    // impossible
    }

    XMLFilterImpl f = new XMLFilterImpl() {
        @Override
        public void setDocumentLocator(Locator locator) {
            super.setDocumentLocator(locator);
            location = new LocatorImpl(locator);
        }
    };
    f.setContentHandler(s2d);

    setHandler(f);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:DomHandlerEx.java


示例2: readAsSOAPMessage

import com.sun.xml.internal.bind.marshaller.SAX2DOMEx; //导入依赖的package包/类
/**
 * Default implementation that uses {@link #writeTo(ContentHandler, ErrorHandler)}
 */
public SOAPMessage readAsSOAPMessage() throws SOAPException {
    SOAPMessage msg = soapVersion.saajMessageFactory.createMessage();
    SAX2DOMEx s2d = new SAX2DOMEx(msg.getSOAPPart());
    try {
        writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER);
    } catch (SAXException e) {
        throw new SOAPException(e);
    }
    for(Attachment att : getAttachments()) {
        AttachmentPart part = msg.createAttachmentPart();
        part.setDataHandler(att.asDataHandler());
        part.setContentId('<'+att.getContentId()+'>');
        msg.addAttachmentPart(part);
    }
    return msg;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:20,代码来源:AbstractMessageImpl.java


示例3: ResultImpl

import com.sun.xml.internal.bind.marshaller.SAX2DOMEx; //导入依赖的package包/类
ResultImpl() {
    try {
        s2d = new SAX2DOMEx();
    } catch (ParserConfigurationException e) {
        throw new AssertionError(e);    // impossible
    }

    XMLFilterImpl f = new XMLFilterImpl() {
        public void setDocumentLocator(Locator locator) {
            super.setDocumentLocator(locator);
            location = new LocatorImpl(locator);
        }
    };
    f.setContentHandler(s2d);

    setHandler(f);
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:18,代码来源:DomHandlerEx.java


示例4: readAsSOAPMessageSax2Dom

import com.sun.xml.internal.bind.marshaller.SAX2DOMEx; //导入依赖的package包/类
public SOAPMessage readAsSOAPMessageSax2Dom(final SOAPVersion soapVersion, final Message message) throws SOAPException {
    SOAPMessage msg = soapVersion.getMessageFactory().createMessage();
    SAX2DOMEx s2d = new SAX2DOMEx(msg.getSOAPPart());
    try {
        message.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER);
    } catch (SAXException e) {
        throw new SOAPException(e);
    }
    addAttachmentsToSOAPMessage(msg, message);
    if (msg.saveRequired())
        msg.saveChanges();
    return msg;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:SAAJFactory.java


示例5: getReferenceParameters

import com.sun.xml.internal.bind.marshaller.SAX2DOMEx; //导入依赖的package包/类
/**
 * Gives a list of Reference Parameters in the Message
 * <p>
 * Headers which have attribute wsa:IsReferenceParameter="true"
 * This is not cached as one may reset the Message.
 *<p>
 */
@Property(MessageContext.REFERENCE_PARAMETERS)
public
@NotNull
List<Element> getReferenceParameters() {
    Message msg = getMessage();
    List<Element> refParams = new ArrayList<Element>();
    if (msg == null) {
        return refParams;
    }
    MessageHeaders hl = msg.getHeaders();
    for (Header h : hl.asList()) {
        String attr = h.getAttribute(AddressingVersion.W3C.nsUri, "IsReferenceParameter");
        if (attr != null && (attr.equals("true") || attr.equals("1"))) {
            Document d = DOMUtil.createDom();
            SAX2DOMEx s2d = new SAX2DOMEx(d);
            try {
                h.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER);
                refParams.add((Element) d.getLastChild());
            } catch (SAXException e) {
                throw new WebServiceException(e);
            }
            /*
            DOMResult result = new DOMResult(d);
            XMLDOMWriterImpl domwriter = new XMLDOMWriterImpl(result);
            try {
                h.writeTo(domwriter);
                refParams.add((Element) result.getNode().getLastChild());
            } catch (XMLStreamException e) {
                throw new WebServiceException(e);
            }
            */
        }
    }
    return refParams;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:43,代码来源:Packet.java


示例6: getReferenceParameters

import com.sun.xml.internal.bind.marshaller.SAX2DOMEx; //导入依赖的package包/类
/**
 * Gives a list of Reference Parameters in the Message
 * <p>
 * Headers which have attribute wsa:IsReferenceParameter="true"
 * This is not cached as one may reset the Message.
 *<p>
 */
@Property(MessageContext.REFERENCE_PARAMETERS)
public @NotNull List<Element> getReferenceParameters() {
    List<Element> refParams =  new ArrayList<Element>();
    HeaderList hl = message.getHeaders();
    for(Header h :hl) {
        String attr = h.getAttribute(AddressingVersion.W3C.nsUri,"IsReferenceParameter");
        if(attr!=null && (attr.equals("true") || attr.equals("1"))) {
            Document d = DOMUtil.createDom();
            SAX2DOMEx s2d = new SAX2DOMEx(d);
            try {
                h.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER);
                refParams.add((Element) d.getLastChild());
            } catch (SAXException e) {
                throw new WebServiceException(e);
            }
            /*
            DOMResult result = new DOMResult(d);
            XMLDOMWriterImpl domwriter = new XMLDOMWriterImpl(result);
            try {
                h.writeTo(domwriter);
                refParams.add((Element) result.getNode().getLastChild());
            } catch (XMLStreamException e) {
                throw new WebServiceException(e);
            }
            */
        }
    }
    return refParams;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:37,代码来源:Packet.java


示例7: getBuilder

import com.sun.xml.internal.bind.marshaller.SAX2DOMEx; //导入依赖的package包/类
private SAX2DOMEx getBuilder() {
    return (SAX2DOMEx)out;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:DOMOutput.java


示例8: marshal

import com.sun.xml.internal.bind.marshaller.SAX2DOMEx; //导入依赖的package包/类
public void marshal(Marshaller _m, T t, Node output) throws JAXBException {
    MarshallerImpl m = (MarshallerImpl)_m;
    m.write(tagName,bi,t,new SAXOutput(new SAX2DOMEx(output)),new DomPostInitAction(output,m.serializer));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:BridgeImpl.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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