1 55 56 package org.jboss.axis.encoding.ser; 57 58 import org.jboss.axis.AxisFault; 59 import org.jboss.axis.attachments.AttachmentUtils; 60 import org.jboss.axis.encoding.DeserializationContext; 61 import org.jboss.axis.encoding.DeserializerImpl; 62 import org.jboss.axis.message.SOAPHandler; 63 import org.jboss.axis.soap.SOAPConstants; 64 import org.jboss.axis.utils.Messages; 65 import org.jboss.logging.Logger; 66 import org.xml.sax.Attributes ; 67 import org.xml.sax.SAXException ; 68 69 import javax.xml.namespace.QName ; 70 71 77 public class JAFDataHandlerDeserializer extends DeserializerImpl 78 { 79 private static Logger log = Logger.getLogger(JAFDataHandlerDeserializer.class.getName()); 80 81 public void startElement(String namespace, String localName, 82 String prefix, Attributes attributes, 83 DeserializationContext context) 84 throws SAXException 85 { 86 87 if (!context.isDoneParsing()) 88 { 89 if (myElement == null) 90 { 91 try 92 { 93 myElement = makeNewElement(namespace, localName, prefix, attributes, context); 94 } 95 catch (AxisFault axisFault) 96 { 97 throw new SAXException (axisFault); 98 } 99 context.pushNewElement(myElement); 100 } 101 } 102 104 SOAPConstants soapConstants = context.getMessageContext().getSOAPConstants(); 105 106 QName type = context.getTypeFromAttributes(namespace, 107 localName, 108 attributes); 109 if (log.isDebugEnabled()) 110 { 111 log.debug(Messages.getMessage("gotType00", "Deser", "" + type)); 112 } 113 114 String href = attributes.getValue(soapConstants.getAttrHref()); 115 if (href != null) 116 { 117 Object ref = context.getObjectByRef(href); 118 log.debug("About to getActivationDataHandler for: " + ref); 119 try 120 { 121 ref = AttachmentUtils.getActivationDataHandler((org.jboss.axis.Part)ref); 122 } 123 catch (AxisFault e) 124 { 125 log.debug("Failed to get activation data handler", e); 126 } 127 128 setValue(ref); 129 } 130 } 131 132 136 public SOAPHandler onStartChild(String namespace, 137 String localName, 138 String prefix, 139 Attributes attributes, 140 DeserializationContext context) 141 throws SAXException 142 { 143 throw new SAXException (Messages.getMessage("noSubElements", namespace + ":" + localName)); 144 } 145 } 146 | Popular Tags |