1 16 17 package org.apache.axis.encoding.ser; 18 19 import org.apache.axis.attachments.AttachmentUtils; 20 import org.apache.axis.components.logger.LogFactory; 21 import org.apache.axis.encoding.DeserializationContext; 22 import org.apache.axis.encoding.DeserializerImpl; 23 import org.apache.axis.message.SOAPHandler; 24 import org.apache.axis.utils.Messages; 25 import org.apache.axis.soap.SOAPConstants; 26 import org.apache.axis.AxisFault; 27 import org.apache.commons.logging.Log; 28 import org.xml.sax.Attributes ; 29 import org.xml.sax.SAXException ; 30 31 import javax.xml.namespace.QName ; 32 33 38 public class JAFDataHandlerDeserializer extends DeserializerImpl { 39 protected static Log log = 40 LogFactory.getLog(JAFDataHandlerDeserializer.class.getName()); 41 42 public void startElement(String namespace, String localName, 43 String prefix, Attributes attributes, 44 DeserializationContext context) 45 throws SAXException { 46 47 if (!context.isDoneParsing()) { 48 if (myElement == null) { 49 try { 50 myElement = makeNewElement(namespace, localName, prefix, attributes, context); 51 } catch (AxisFault axisFault) { 52 throw new SAXException (axisFault); 53 } 54 context.pushNewElement(myElement); 55 } 56 } 57 59 SOAPConstants soapConstants = context.getSOAPConstants(); 60 61 QName type = context.getTypeFromAttributes(namespace, 62 localName, 63 attributes); 64 if (log.isDebugEnabled()) { 65 log.debug(Messages.getMessage("gotType00", "Deser", "" + type)); 66 } 67 68 String href = attributes.getValue(soapConstants.getAttrHref()); 69 if (href != null) { 70 Object ref = context.getObjectByRef(href); 71 try{ 72 ref = AttachmentUtils.getActivationDataHandler((org.apache.axis.Part)ref); 73 }catch(org.apache.axis.AxisFault e){;} 74 75 setValue(ref); 76 } 77 } 78 79 83 public SOAPHandler onStartChild(String namespace, 84 String localName, 85 String prefix, 86 Attributes attributes, 87 DeserializationContext context) 88 throws SAXException { 89 throw new SAXException (Messages.getMessage( 90 "noSubElements", namespace + ":" + localName)); 91 } 92 } 93 | Popular Tags |