1 57 58 package org.apache.soap.util.xml; 59 60 import com.ibm.xmi.job.*; 61 import java.io.*; 62 import java.util.*; 63 import org.w3c.dom.*; 64 import org.apache.soap.rpc.SOAPContext; 65 66 71 public class XMISerializer implements Serializer 72 { 73 public static int CONV_BSIZE=0x400; 74 75 public void marshall(String inScopeEncStyle, Class javaType, Object src, 76 Object context, Writer sink, NSStack nsStack, 77 XMLJavaMappingRegistry xjmr, SOAPContext ctx) 78 throws IllegalArgumentException , IOException 79 80 { 81 82 87 if (src == null) 89 { 90 sink.write("<null type=\"" + javaType.getName() + "\"/>"); 91 return; 92 } 93 else if( javaType ==java.lang.String .class ) 94 { 95 sink.write("<java.lang.String value='" + src + "' />"); 96 return; 97 } 98 99 Vector olist = new Vector(); 101 olist.addElement(src); 102 103 104 ByteArrayOutputStream tmpout = new ByteArrayOutputStream(); 105 108 110 com.ibm.xmi.framework.WriterFactory.setInline(true); 111 Job.writeObjects((List)olist, (OutputStream)tmpout); 112 sink.write(tmpout.toString()); 113 114 125 tmpout.close(); 126 } 128 129 } 130 | Popular Tags |