1 30 31 package org.jboss.axis.message; 32 33 34 import org.jboss.axis.Constants; 35 import org.jboss.axis.encoding.Callback; 36 import org.jboss.axis.encoding.CallbackTarget; 37 import org.jboss.axis.encoding.DeserializationContext; 38 import org.jboss.axis.encoding.Deserializer; 39 import org.xml.sax.Attributes ; 40 import org.xml.sax.SAXException ; 41 42 import javax.xml.namespace.QName ; 43 44 45 52 53 public class SOAPFaultCodeBuilder extends SOAPHandler implements Callback 54 55 { 56 57 59 protected QName faultCode = null; 60 61 protected SOAPFaultCodeBuilder next = null; 62 63 64 public SOAPFaultCodeBuilder() 65 { 66 67 } 68 69 70 public QName getFaultCode() 71 { 72 73 return faultCode; 74 75 } 76 77 78 public SOAPFaultCodeBuilder getNext() 79 { 80 81 return next; 82 83 } 84 85 86 public SOAPHandler onStartChild(String namespace, 87 88 String name, 89 90 String prefix, 91 92 Attributes attributes, 93 94 DeserializationContext context) 95 96 throws SAXException 97 98 { 99 100 101 QName thisQName = new QName (namespace, name); 102 103 if (thisQName.equals(Constants.QNAME_FAULTVALUE_SOAP12)) 104 { 105 106 Deserializer currentDeser = null; 107 108 currentDeser = context.getDeserializerForType(Constants.XSD_QNAME); 109 110 if (currentDeser != null) 111 { 112 113 currentDeser.registerValueTarget(new CallbackTarget(this, thisQName)); 114 115 } 116 117 return (SOAPHandler)currentDeser; 118 119 } 120 else if (thisQName.equals(Constants.QNAME_FAULTSUBCODE_SOAP12)) 121 { 122 123 return (next = new SOAPFaultCodeBuilder()); 124 125 } 126 else 127 128 return null; 129 130 } 131 132 133 134 145 146 public void setValue(Object value, Object hint) 147 { 148 149 QName thisQName = (QName )hint; 150 151 if (thisQName.equals(Constants.QNAME_FAULTVALUE_SOAP12)) 152 { 153 154 faultCode = (QName )value; 155 156 } 157 158 } 159 160 } 161 162 | Popular Tags |