ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1700041 - in /webservices/axiom/trunk: aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/ implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/ implementations/axiom-impl/src/main/java/org/apache/a...
Date Sat, 29 Aug 2015 14:42:01 GMT
Author: veithen
Date: Sat Aug 29 14:42:01 2015
New Revision: 1700041

URL: http://svn.apache.org/r1700041
Log:
Clean up the SOAPFaultText implementations.

Modified:
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12FaultTextSupport.aj
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultTextImpl.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultTextImpl.java

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12FaultTextSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12FaultTextSupport.aj?rev=1700041&r1=1700040&r2=1700041&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12FaultTextSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12FaultTextSupport.aj
Sat Aug 29 14:42:01 2015
@@ -18,10 +18,31 @@
  */
 package org.apache.axiom.soap.impl.common;
 
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.impl.common.AxiomElement;
+import org.apache.axiom.om.impl.common.OMNamespaceImpl;
+import org.apache.axiom.soap.SOAP12Constants;
 
 public aspect AxiomSOAP12FaultTextSupport {
+    private static final OMNamespace LANG_NAMESPACE = new OMNamespaceImpl(
+            SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI,
+            SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX);
+    private static final QName LANG_QNAME = new QName(
+            SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI,
+            SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
+            SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX);
+    
     public final Class<? extends AxiomElement> AxiomSOAP12FaultText.getElementType()
{
         return AxiomSOAP12FaultText.class;
     }
+
+    public final void AxiomSOAP12FaultText.setLang(String lang) {
+        addAttribute(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME, lang, LANG_NAMESPACE);
+    }
+    
+    public final String AxiomSOAP12FaultText.getLang() {
+        return getAttributeValue(LANG_QNAME);
+    }
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultTextImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultTextImpl.java?rev=1700041&r1=1700040&r2=1700041&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultTextImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultTextImpl.java
Sat Aug 29 14:42:01 2015
@@ -19,29 +19,15 @@
 
 package org.apache.axiom.soap.impl.dom.soap12;
 
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.impl.dom.DocumentImpl;
-import org.apache.axiom.om.impl.dom.NSAwareAttribute;
-import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.SOAPProcessingException;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultText;
 import org.apache.axiom.soap.impl.dom.SOAPElement;
 
 public class SOAP12FaultTextImpl extends SOAPElement implements AxiomSOAP12FaultText {
-    private OMAttribute langAttr;
-    private final OMNamespace langNamespace;
-
     public SOAP12FaultTextImpl(OMFactory factory) {
         super(factory);
-        // TODO: get rid of this crap
-        this.langNamespace = factory.createOMNamespace(
-                SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI,
-                SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX);
     }
 
     public void checkParent(OMElement parent) throws SOAPProcessingException {
@@ -51,25 +37,4 @@ public class SOAP12FaultTextImpl extends
                             "as the parent. But received some other implementation");
         }
     }
-
-    public void setLang(String lang) {
-        langAttr =
-                new NSAwareAttribute((DocumentImpl)getOwnerDocument(),
-                             SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
-                             langNamespace,
-                             lang, getOMFactory());
-        this.addAttribute(langAttr);
-    }
-
-    public String getLang() {
-        if (langAttr == null) {
-            langAttr =
-                    this.getAttribute(
-                            new QName(langNamespace.getNamespaceURI(),
-                                      SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
-                                      SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX));
-        }
-
-        return langAttr == null ? null : langAttr.getAttributeValue();
-    }
 }
\ No newline at end of file

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultTextImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultTextImpl.java?rev=1700041&r1=1700040&r2=1700041&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultTextImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultTextImpl.java
Sat Aug 29 14:42:01 2015
@@ -19,28 +19,15 @@
 
 package org.apache.axiom.soap.impl.llom.soap12;
 
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.impl.llom.OMAttributeImpl;
-import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.SOAPProcessingException;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultText;
 import org.apache.axiom.soap.impl.llom.SOAPElement;
 
 public class SOAP12FaultTextImpl extends SOAPElement implements AxiomSOAP12FaultText {
-    private OMAttribute langAttr;
-    private OMNamespace langNamespace = null;
-
     public SOAP12FaultTextImpl(OMFactory factory) {
         super(factory);
-        // TODO: get rid of this crap
-        this.langNamespace = factory.createOMNamespace(
-                SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI,
-                SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX);
     }
 
     public void checkParent(OMElement parent) throws SOAPProcessingException {
@@ -49,28 +36,4 @@ public class SOAP12FaultTextImpl extends
                     "Expecting SOAP12FaultReasonImpl as parent, got " + parent.getClass());
         }
     }
-
-    public void setLang(String lang) {
-        //langAttr = new OMAttributeImpl(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
parent.getNamespace(), lang);
-        langAttr =
-                new OMAttributeImpl(
-                        SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
-                        langNamespace,
-                        lang,
-                        getOMFactory());
-        this.addAttribute(langAttr);
-    }
-
-    public String getLang() {
-        if (langAttr == null) {
-            //langAttr = this.getFirstAttribute(new QName(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
parent.getNamespace().getName()));
-            langAttr =
-                    this.getAttribute(
-                            new QName(langNamespace.getNamespaceURI(),
-                                      SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
-                                      SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX));
-        }
-
-        return langAttr == null ? null : langAttr.getAttributeValue();
-    }
 }



Mime
View raw message