1 55 56 package org.jboss.axis.encoding.ser; 57 58 import org.jboss.axis.encoding.DeserializationContext; 59 import org.xml.sax.Attributes ; 60 import org.xml.sax.SAXException ; 61 62 import javax.xml.namespace.QName ; 63 64 71 public class QNameDeserializer extends SimpleDeserializer 72 { 73 74 private DeserializationContext context = null; 75 76 80 public QNameDeserializer(Class javaType, QName xmlType) 81 { 82 super(javaType, xmlType); 83 } 85 89 public Object makeValue(String source) 90 { 91 int colon = source.lastIndexOf(":"); 92 String namespace = colon < 0 ? "" : 93 context.getNamespaceURI(source.substring(0, colon)); 94 String localPart = colon < 0 ? source : source.substring(colon + 1); 95 return new QName (namespace, localPart); 96 } 98 public void onStartElement(String namespace, String localName, 99 String prefix, Attributes attributes, 100 DeserializationContext context) 101 throws SAXException 102 { 103 this.context = context; 104 } } 106 | Popular Tags |