1 16 package org.jboss.axis.message; 17 18 19 import org.jboss.axis.Constants; 20 import org.jboss.axis.encoding.Callback; 21 import org.jboss.axis.encoding.CallbackTarget; 22 import org.jboss.axis.encoding.DeserializationContext; 23 import org.jboss.axis.encoding.Deserializer; 24 import org.xml.sax.Attributes ; 25 import org.xml.sax.SAXException ; 26 27 import javax.xml.namespace.QName ; 28 import java.util.ArrayList ; 29 30 31 36 37 public class SOAPFaultReasonBuilder extends SOAPHandler implements Callback 38 39 { 40 41 44 45 private ArrayList text = new ArrayList (); 46 47 private SOAPFaultBuilder faultBuilder; 48 49 50 public SOAPFaultReasonBuilder(SOAPFaultBuilder faultBuilder) 51 { 52 53 this.faultBuilder = faultBuilder; 54 55 } 56 57 58 public SOAPHandler onStartChild(String namespace, 59 60 String name, 61 62 String prefix, 63 64 Attributes attributes, 65 66 DeserializationContext context) 67 68 throws SAXException 69 70 { 71 72 QName thisQName = new QName (namespace, name); 73 74 if (thisQName.equals(Constants.QNAME_TEXT_SOAP12)) 75 { 76 77 Deserializer currentDeser = null; 78 79 currentDeser = context.getDeserializerForType(Constants.XSD_STRING); 80 81 if (currentDeser != null) 82 { 83 84 currentDeser.registerValueTarget(new CallbackTarget(faultBuilder, thisQName)); 85 86 } 87 88 return (SOAPHandler)currentDeser; 89 90 } 91 else 92 { 93 94 return null; 95 96 } 97 98 } 99 100 101 111 112 public void setValue(Object value, Object hint) 113 { 114 115 text.add(value); 116 117 } 118 119 120 public ArrayList getText() 121 { 122 123 return text; 124 125 } 126 127 } 128 129 | Popular Tags |