1 // $Id: SerializerUtils.java,v 1.2 2004/02/12 22:57:32 powerpete Exp $
2 // [JMP, 06.02.2004] Created this file.
3 package org.jface.stepmt.transform.util;
4
5 import java.io.IOException;
6 import java.io.OutputStream;
7
8 import org.apache.xml.serializer.OutputPropertiesFactory;
9 import org.apache.xml.serializer.Serializer;
10 import org.apache.xml.serializer.SerializerFactory;
11 import org.xml.sax.ContentHandler;
12
13 /***
14 * @author <a href="mailto:powerpete@users.sf.net">M. Petersen</a>
15 * @version $Id: SerializerUtils.java,v 1.2 2004/02/12 22:57:32 powerpete Exp $
16 */
17 public class SerializerUtils
18 {
19 private SerializerUtils()
20 {}
21
22 public static ContentHandler getContentHandler(
23 String properties,
24 OutputStream out)
25 throws IOException
26 {
27 if (out == null)
28 {
29 throw new NullPointerException("OutputStream is null.");
30 }
31 Serializer serializer =
32 SerializerFactory.getSerializer(
33 OutputPropertiesFactory.getDefaultMethodProperties(properties));
34 serializer.setOutputStream(out);
35 return serializer.asContentHandler();
36 }
37 }
This page was automatically generated by Maven