本文整理汇总了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());
}
}
}
示例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());
}
}
}
示例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());
}
}
}
示例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());
}
}