1 16 package org.apache.axis.message; 17 18 import org.apache.axis.Constants; 19 import org.apache.axis.encoding.Callback; 20 import org.apache.axis.encoding.CallbackTarget; 21 import org.apache.axis.encoding.DeserializationContext; 22 import org.apache.axis.encoding.Deserializer; 23 import org.xml.sax.Attributes ; 24 import org.xml.sax.SAXException ; 25 26 import javax.xml.namespace.QName ; 27 28 35 public class SOAPFaultCodeBuilder extends SOAPHandler implements Callback 36 { 37 protected QName faultCode = null; 39 protected SOAPFaultCodeBuilder next = null; 40 41 public SOAPFaultCodeBuilder() { 42 } 43 44 public QName getFaultCode() { 45 return faultCode; 46 } 47 48 public SOAPFaultCodeBuilder getNext() { 49 return next; 50 } 51 52 public SOAPHandler onStartChild(String namespace, 53 String name, 54 String prefix, 55 Attributes attributes, 56 DeserializationContext context) 57 throws SAXException 58 { 59 60 QName thisQName = new QName (namespace, name); 61 if (thisQName.equals(Constants.QNAME_FAULTVALUE_SOAP12)) { 62 Deserializer currentDeser = null; 63 currentDeser = context.getDeserializerForType(Constants.XSD_QNAME); 64 if (currentDeser != null) { 65 currentDeser.registerValueTarget(new CallbackTarget(this, thisQName)); 66 } 67 return (SOAPHandler)currentDeser; 68 } else if (thisQName.equals(Constants.QNAME_FAULTSUBCODE_SOAP12)) { 69 return (next = new SOAPFaultCodeBuilder()); 70 } else 71 return null; 72 } 73 74 80 public void setValue(Object value, Object hint) { 81 QName thisQName = (QName )hint; 82 if (thisQName.equals(Constants.QNAME_FAULTVALUE_SOAP12)) { 83 faultCode = (QName )value; 84 } 85 } 86 } 87 | Popular Tags |