1 package org.apache.axis2.soap.impl.llom; 2 3 import org.apache.axis2.om.OMAbstractFactory; 4 import org.apache.axis2.om.OMAttribute; 5 import org.apache.axis2.om.OMNamespace; 6 import org.apache.axis2.om.OMXMLParserWrapper; 7 import org.apache.axis2.om.impl.llom.OMAttributeImpl; 8 import org.apache.axis2.soap.SOAPFaultReason; 9 import org.apache.axis2.soap.SOAPFaultText; 10 import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants; 11 12 import javax.xml.namespace.QName ; 13 14 30 public abstract class SOAPFaultTextImpl extends SOAPElement implements SOAPFaultText { 31 protected OMAttribute langAttr; 32 protected OMNamespace langNamespace = OMAbstractFactory.getOMFactory().createOMNamespace(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI,SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX); 33 34 protected SOAPFaultTextImpl(SOAPFaultReason parent) throws SOAPProcessingException { 35 super(parent, SOAP12Constants.SOAP_FAULT_TEXT_LOCAL_NAME, true); 36 } 37 38 protected SOAPFaultTextImpl(SOAPFaultReason parent, OMXMLParserWrapper builder) { 39 super(parent, SOAP12Constants.SOAP_FAULT_TEXT_LOCAL_NAME, builder); 40 } 41 42 43 public void setLang(String lang) { 44 langAttr = new OMAttributeImpl(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME, langNamespace, lang); 46 this.addAttribute(langAttr); 47 } 48 49 public String getLang() { 50 if (langAttr == null) { 51 langAttr = this.getFirstAttribute(new QName (langNamespace.getName(),SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX )); 53 } 54 55 return langAttr == null ? null : langAttr.getValue(); 56 } 57 } 58 | Popular Tags |