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.SimpleValueSerializer; 61 import org.jboss.axis.wsdl.fromJava.Types; 62 import org.w3c.dom.Element ; 63 import org.xml.sax.Attributes ; 64 65 import javax.xml.namespace.QName ; 66 import java.io.IOException ; 67 68 71 public class QNameSerializer implements SimpleValueSerializer 72 { 73 74 77 public void serialize(QName name, Attributes attributes, 78 Object value, SerializationContext context) 79 throws IOException 80 { 81 String qnameString = getValueAsString(value, context); 84 context.startElement(name, attributes); 85 context.writeString(qnameString); 86 context.endElement(); 87 } 88 89 public String getValueAsString(Object value, SerializationContext context) 90 { 91 return context.qName2String((QName )value); 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 |