1 package org.apache.axis.message; 2 3 import org.apache.axis.Constants; 4 import org.apache.axis.encoding.Callback; 5 import org.apache.axis.encoding.CallbackTarget; 6 import org.apache.axis.encoding.DeserializationContext; 7 import org.apache.axis.encoding.Deserializer; 8 import org.xml.sax.Attributes ; 9 import org.xml.sax.SAXException ; 10 11 import javax.xml.namespace.QName ; 12 import java.util.ArrayList ; 13 14 29 30 35 public class SOAPFaultReasonBuilder extends SOAPHandler implements Callback 36 { 37 38 private ArrayList text = new ArrayList (); 39 private SOAPFaultBuilder faultBuilder; 40 41 public SOAPFaultReasonBuilder(SOAPFaultBuilder faultBuilder) { 42 this.faultBuilder = faultBuilder; 43 } 44 45 public SOAPHandler onStartChild(String namespace, 46 String name, 47 String prefix, 48 Attributes attributes, 49 DeserializationContext context) 50 throws SAXException 51 { 52 QName thisQName = new QName (namespace, name); 53 if (thisQName.equals(Constants.QNAME_TEXT_SOAP12)) { 54 Deserializer currentDeser = null; 55 currentDeser = context.getDeserializerForType(Constants.XSD_STRING); 56 if (currentDeser != null) { 57 currentDeser.registerValueTarget( 58 new CallbackTarget(faultBuilder, thisQName)); 59 } 60 return (SOAPHandler)currentDeser; 61 } else { 62 return null; 63 } 64 } 65 66 74 public void setValue(Object value, Object hint) { 75 text.add(value); 76 } 77 78 public ArrayList getText() { 79 return text; 80 } 81 } 82 | Popular Tags |