1 16 17 package org.apache.axis.encoding.ser; 18 19 import org.apache.axis.Constants; 20 import org.apache.axis.encoding.SerializationContext; 21 import org.apache.axis.encoding.Serializer; 22 import org.apache.axis.utils.Messages; 23 import org.apache.axis.wsdl.fromJava.Types; 24 import org.w3c.dom.Element ; 25 import org.w3c.dom.Document ; 26 import org.xml.sax.Attributes ; 27 28 import javax.xml.namespace.QName ; 29 import java.io.IOException ; 30 31 36 37 public class DocumentSerializer implements Serializer { 38 41 public void serialize(QName name, Attributes attributes, 42 Object value, SerializationContext context) 43 throws IOException 44 { 45 if (!(value instanceof Document )) 46 throw new IOException (Messages.getMessage("cantSerialize01")); 47 48 context.startElement(name, attributes); 49 Document document = (Document )value; 50 context.writeDOMElement(document.getDocumentElement()); 51 context.endElement(); 52 } 53 54 public String getMechanismType() { return Constants.AXIS_SAX; } 55 56 67 public Element writeSchema(Class javaType, Types types) throws Exception { 68 return null; 69 } 70 } 71 | Popular Tags |