1 55 56 package org.jboss.axis.encoding.ser; 57 58 import org.jboss.axis.Constants; 59 import org.jboss.axis.encoding.SerializationContext; 60 import org.jboss.axis.encoding.Serializer; 61 import org.jboss.axis.utils.Messages; 62 import org.jboss.axis.wsdl.fromJava.Types; 63 import org.w3c.dom.Document ; 64 import org.w3c.dom.Element ; 65 import org.xml.sax.Attributes ; 66 67 import javax.xml.namespace.QName ; 68 import java.io.IOException ; 69 70 75 76 public class DocumentSerializer implements Serializer 77 { 78 81 public void serialize(QName name, Attributes attributes, 82 Object value, SerializationContext context) 83 throws IOException 84 { 85 if (!(value instanceof Document )) 86 throw new IOException (Messages.getMessage("cantSerialize01")); 87 88 context.startElement(name, attributes); 89 Document document = (Document )value; 90 context.writeDOMElement(document.getDocumentElement()); 91 context.endElement(); 92 } 93 94 public String getMechanismType() 95 { 96 return Constants.AXIS_SAX; 97 } 98 99 110 public Element writeSchema(Class javaType, Types types) throws Exception 111 { 112 return null; 113 } 114 } 115 | Popular Tags |