ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1718068 - in /webservices/axiom/branches/datatypes/aspects: core-aspects/src/main/java/org/apache/axiom/core/ om-aspects/src/main/java/org/apache/axiom/soap/impl/common/
Date Sat, 05 Dec 2015 11:00:36 GMT
Author: veithen
Date: Sat Dec  5 11:00:36 2015
New Revision: 1718068

URL: http://svn.apache.org/viewvc?rev=1718068&view=rev
Log:
Use the datatypes library to manipulate SOAP fault codes.

Modified:
    webservices/axiom/branches/datatypes/aspects/core-aspects/src/main/java/org/apache/axiom/core/ContextAccessorImpl.java
    webservices/axiom/branches/datatypes/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElementSupport.aj
    webservices/axiom/branches/datatypes/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11FaultCodeSupport.aj
    webservices/axiom/branches/datatypes/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12FaultClassifierSupport.aj

Modified: webservices/axiom/branches/datatypes/aspects/core-aspects/src/main/java/org/apache/axiom/core/ContextAccessorImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/datatypes/aspects/core-aspects/src/main/java/org/apache/axiom/core/ContextAccessorImpl.java?rev=1718068&r1=1718067&r2=1718068&view=diff
==============================================================================
--- webservices/axiom/branches/datatypes/aspects/core-aspects/src/main/java/org/apache/axiom/core/ContextAccessorImpl.java
(original)
+++ webservices/axiom/branches/datatypes/aspects/core-aspects/src/main/java/org/apache/axiom/core/ContextAccessorImpl.java
Sat Dec  5 11:00:36 2015
@@ -34,7 +34,8 @@ final class ContextAccessorImpl implemen
     }
 
     public void declareNamespace(CoreElement element, Semantics semantics, String prefix,
String namespaceURI) {
-        // TODO
-        throw new UnsupportedOperationException();
+        CoreNamespaceDeclaration decl = element.coreCreateNode(CoreNamespaceDeclaration.class);
+        decl.coreSetDeclaredNamespace(prefix, namespaceURI);
+        element.coreAppendAttribute(decl);
     }
 }

Modified: webservices/axiom/branches/datatypes/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/datatypes/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElementSupport.aj?rev=1718068&r1=1718067&r2=1718068&view=diff
==============================================================================
--- webservices/axiom/branches/datatypes/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElementSupport.aj
(original)
+++ webservices/axiom/branches/datatypes/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElementSupport.aj
Sat Dec  5 11:00:36 2015
@@ -234,7 +234,6 @@ public aspect CoreElementSupport {
     }
     
     public final <T> void CoreElement.coreSetValue(Type<T> type, T value, Semantics
semantics) {
-        // TODO: actually set value
-        type.format(value, ContextAccessorImpl.INSTANCE, this, semantics);
+        coreSetCharacterData(type.format(value, ContextAccessorImpl.INSTANCE, this, semantics),
semantics);
     }
 }

Modified: webservices/axiom/branches/datatypes/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11FaultCodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/datatypes/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11FaultCodeSupport.aj?rev=1718068&r1=1718067&r2=1718068&view=diff
==============================================================================
--- webservices/axiom/branches/datatypes/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11FaultCodeSupport.aj
(original)
+++ webservices/axiom/branches/datatypes/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11FaultCodeSupport.aj
Sat Dec  5 11:00:36 2015
@@ -18,11 +18,16 @@
  */
 package org.apache.axiom.soap.impl.common;
 
+import java.text.ParseException;
+
 import javax.xml.namespace.QName;
 
 import org.apache.axiom.core.CoreNode;
+import org.apache.axiom.datatype.xsd.XSQNameType;
+import org.apache.axiom.om.impl.common.AxiomSemantics;
 import org.apache.axiom.soap.SOAPFaultSubCode;
 import org.apache.axiom.soap.SOAPFaultValue;
+import org.apache.axiom.soap.SOAPProcessingException;
 import org.apache.axiom.soap.impl.intf.AxiomSOAP11FaultCode;
 
 public aspect AxiomSOAP11FaultCodeSupport {
@@ -47,10 +52,14 @@ public aspect AxiomSOAP11FaultCodeSuppor
     }
 
     public final QName AxiomSOAP11FaultCode.getValueAsQName() {
-        return getTextAsQName();
+        try {
+            return coreGetValue(XSQNameType.INSTANCE, AxiomSemantics.INSTANCE);
+        } catch (ParseException ex) {
+            throw new SOAPProcessingException("Invalid fault code", ex);
+        }
     }
 
     public final void AxiomSOAP11FaultCode.setValue(QName value) {
-        setText(value);
+        coreSetValue(XSQNameType.INSTANCE, value, AxiomSemantics.INSTANCE);
     }
 }

Modified: webservices/axiom/branches/datatypes/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12FaultClassifierSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/datatypes/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12FaultClassifierSupport.aj?rev=1718068&r1=1718067&r2=1718068&view=diff
==============================================================================
--- webservices/axiom/branches/datatypes/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12FaultClassifierSupport.aj
(original)
+++ webservices/axiom/branches/datatypes/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12FaultClassifierSupport.aj
Sat Dec  5 11:00:36 2015
@@ -18,12 +18,18 @@
  */
 package org.apache.axiom.soap.impl.common;
 
+import java.text.ParseException;
+
 import javax.xml.namespace.QName;
 
+import org.apache.axiom.datatype.xsd.XSQNameType;
+import org.apache.axiom.om.impl.common.AxiomSemantics;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.SOAPFaultSubCode;
 import org.apache.axiom.soap.SOAPFaultValue;
+import org.apache.axiom.soap.SOAPProcessingException;
 import org.apache.axiom.soap.impl.intf.AxiomSOAP12FaultClassifier;
+import org.apache.axiom.soap.impl.intf.AxiomSOAP12FaultValue;
 
 public aspect AxiomSOAP12FaultClassifierSupport {
     private static final Class<?>[] sequence = { SOAPFaultValue.class, SOAPFaultSubCode.class
};
@@ -46,7 +52,11 @@ public aspect AxiomSOAP12FaultClassifier
 
     public final QName AxiomSOAP12FaultClassifier.getValueAsQName() {
         SOAPFaultValue value = getValue();
-        return value == null ? null : value.getTextAsQName();
+        try {
+            return value == null ? null : ((AxiomSOAP12FaultValue)value).coreGetValue(XSQNameType.INSTANCE,
AxiomSemantics.INSTANCE);
+        } catch (ParseException ex) {
+            throw new SOAPProcessingException("Invalid fault code", ex);
+        }
     }
     
     public final void AxiomSOAP12FaultClassifier.setValue(QName value) {
@@ -54,6 +64,6 @@ public aspect AxiomSOAP12FaultClassifier
         if (valueElement == null) {
             valueElement = ((SOAP12Factory)getOMFactory()).internalCreateSOAPFaultValue(this,
null);
         }
-        valueElement.setText(value);
+        ((AxiomSOAP12FaultValue)valueElement).coreSetValue(XSQNameType.INSTANCE, value, AxiomSemantics.INSTANCE);
     }
 }



Mime
View raw message