1 55 56 59 package org.jboss.axis.deployment.wsdd; 60 61 import org.jboss.axis.description.FaultDesc; 62 import org.jboss.axis.encoding.SerializationContext; 63 import org.jboss.axis.utils.XMLUtils; 64 import org.w3c.dom.Element ; 65 import org.xml.sax.helpers.AttributesImpl ; 66 67 import javax.xml.namespace.QName ; 68 import java.io.IOException ; 69 70 public class WSDDFault extends WSDDElement 71 { 72 FaultDesc desc; 73 74 public WSDDFault(FaultDesc desc) 75 { 76 this.desc = desc; 77 } 78 79 85 public WSDDFault(Element e) throws WSDDException 86 { 87 super(e); 88 89 desc = new FaultDesc(); 90 91 String nameStr = e.getAttribute(ATTR_NAME); 92 if (nameStr != null && !nameStr.equals("")) 93 desc.setName(nameStr); 94 95 String qNameStr = e.getAttribute(ATTR_QNAME); 96 if (qNameStr != null && !qNameStr.equals("")) 97 desc.setQName(XMLUtils.getQNameFromString(qNameStr, e)); 98 99 String classNameStr = e.getAttribute(ATTR_CLASS); 100 if (classNameStr != null && !classNameStr.equals("")) 101 desc.setClassName(classNameStr); 102 103 String xmlTypeStr = e.getAttribute(ATTR_TYPE); 104 if (xmlTypeStr != null && !xmlTypeStr.equals("")) 105 desc.setXmlType(XMLUtils.getQNameFromString(xmlTypeStr, e)); 106 } 107 108 111 protected QName getElementName() 112 { 113 return QNAME_FAULT; 114 } 115 116 119 public void writeToContext(SerializationContext context) 120 throws IOException 121 { 122 AttributesImpl attrs = new AttributesImpl (); 123 124 attrs.addAttribute("", ATTR_QNAME, ATTR_QNAME, 125 "CDATA", 126 context.qName2String(desc.getQName())); 127 128 attrs.addAttribute("", ATTR_CLASS, ATTR_CLASS, 129 "CDATA", desc.getClassName()); 130 131 attrs.addAttribute("", ATTR_TYPE, ATTR_TYPE, 132 "CDATA", 133 context.qName2String(desc.getXmlType())); 134 135 context.startElement(getElementName(), attrs); 136 context.endElement(); 137 } 138 139 public FaultDesc getFaultDesc() 140 { 141 return desc; 142 } 143 144 public void setFaultDesc(FaultDesc desc) 145 { 146 this.desc = desc; 147 } 148 } 149 | Popular Tags |