当前位置: 首页>>代码示例>>Java>>正文


Java EfficientStreamingTransformer类代码示例

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


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

示例1: output

import com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer; //导入依赖的package包/类
/**
 * Serialize to FI if boolean parameter set.
 */
public void output(OutputStream out, boolean isFastInfoset)
    throws IOException
{
    if (!isFastInfoset) {
        output(out);
    }
    else {
        try {
            // Run transform and generate FI output from content
            Source source = getContent();
            Transformer transformer = EfficientStreamingTransformer.newTransformer();
                transformer.transform(getContent(),
                    FastInfosetReflection.FastInfosetResult_new(out));
        }
        catch (Exception ex) {
            throw new IOException(ex.getMessage());
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:EnvelopeImpl.java

示例2: output

import com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer; //导入依赖的package包/类
/**
 * Serialize to FI if boolean parameter set.
 */
@Override
public void output(OutputStream out, boolean isFastInfoset)
    throws IOException
{
    if (!isFastInfoset) {
        output(out);
    }
    else {
        try {
            // Run transform and generate FI output from content
            Transformer transformer = EfficientStreamingTransformer.newTransformer();
                transformer.transform(getContent(),
                    FastInfosetReflection.FastInfosetResult_new(out));
        }
        catch (Exception ex) {
            throw new IOException(ex.getMessage());
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:EnvelopeImpl.java

示例3: output

import com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer; //导入依赖的package包/类
/**
 * Serialize to FI if boolean parameter set.
 */
public void output(OutputStream out, boolean isFastInfoset)
    throws IOException
{
    if (!isFastInfoset) {
        output(out);
    }
    else {
        try {
            // Run transform and generate FI output from content
            Transformer transformer = EfficientStreamingTransformer.newTransformer();
                transformer.transform(getContent(),
                    FastInfosetReflection.FastInfosetResult_new(out));
        }
        catch (Exception ex) {
            throw new IOException(ex.getMessage());
        }
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:22,代码来源:EnvelopeImpl.java

示例4: writeTo

import com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer; //导入依赖的package包/类
/**
 * construct an object from a byte stream
 * (similar semantically to previous method, we are deciding
 *  which one to support)
 */
public void writeTo(Object obj, String mimeType, OutputStream os)
    throws IOException {
    if (!mimeType.startsWith("text/xml") && !mimeType.startsWith("application/xml"))
        throw new IOException(
            "Invalid content type \"" + mimeType + "\" for XmlDCH");


    try {
        Transformer transformer = EfficientStreamingTransformer.newTransformer();
        StreamResult result = new StreamResult(os);
        if (obj instanceof DataSource) {
            // Streaming transform applies only to javax.xml.transform.StreamSource
            transformer.transform((Source) getContent((DataSource)obj), result);
        } else {
            Source src=null;
            if (obj instanceof String) {
                 src= new StreamSource(new java.io.StringReader((String) obj));
            } else {
                src=(Source) obj;
            }
            transformer.transform(src, result);
        }
    } catch (Exception ex) {
        throw new IOException(
            "Unable to run the JAXP transformer on a stream "
                + ex.getMessage());
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:34,代码来源:XmlDataContentHandler.java


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