1 16 17 package org.apache.axis.encoding.ser; 18 19 import org.apache.axis.encoding.DeserializationContext; 20 import org.xml.sax.Attributes ; 21 import org.xml.sax.SAXException ; 22 23 import javax.xml.namespace.QName ; 24 25 32 public class QNameDeserializer extends SimpleDeserializer { 33 34 private DeserializationContext context = null; 35 36 40 public QNameDeserializer(Class javaType, QName xmlType) { 41 super(javaType, xmlType); 42 } 44 48 public Object makeValue(String source) { 49 source = source.trim(); 50 int colon = source.lastIndexOf(":"); 51 String namespace = colon < 0 ? "" : 52 context.getNamespaceURI(source.substring(0, colon)); 53 String localPart = colon < 0 ? source : source.substring(colon + 1); 54 return new QName (namespace, localPart); 55 } 57 public void onStartElement(String namespace, String localName, 58 String prefix, Attributes attributes, 59 DeserializationContext context) 60 throws SAXException 61 { 62 this.context = context; 63 } } 65 | Popular Tags |