ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1700160 - in /webservices/axiom/trunk: aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/ aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/ implementations/axiom-dom/src/main/java/org/apache/axiom/om/...
Date Sun, 30 Aug 2015 20:37:11 GMT
Author: veithen
Date: Sun Aug 30 20:37:10 2015
New Revision: 1700160

URL: http://svn.apache.org/r1700160
Log:
Change the Axiom implementation to use the NodeFactory API directly instead of extending it.

Modified:
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactory.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj?rev=1700160&r1=1700159&r2=1700160&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj
Sun Aug 30 20:37:10 2015
@@ -50,7 +50,6 @@ import org.apache.axiom.om.OMOutputForma
 import org.apache.axiom.om.OMSourcedElement;
 import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.common.factory.AxiomNodeFactory;
 import org.apache.axiom.om.impl.common.serializer.push.OutputException;
 import org.apache.axiom.om.impl.common.serializer.push.Serializer;
 import org.apache.axiom.om.impl.util.OMSerializerUtil;
@@ -365,8 +364,10 @@ public aspect AxiomElementSupport {
 
     public final OMNamespace AxiomElement.addNamespaceDeclaration(String uri, String prefix)
{
         OMNamespace ns = new OMNamespaceImpl(uri, prefix);
+        AxiomNamespaceDeclaration decl = (AxiomNamespaceDeclaration)coreGetNodeFactory().createNamespaceDeclaration();
+        decl.setDeclaredNamespace(ns);
         try {
-            coreAppendAttribute(((AxiomNodeFactory)getOMFactory()).createNamespaceDeclaration(ns),
NodeMigrationPolicy.MOVE_ALWAYS);
+            coreAppendAttribute(decl, NodeMigrationPolicy.MOVE_ALWAYS);
         } catch (NodeMigrationException ex) {
             throw AxiomExceptionTranslator.translate(ex);
         }
@@ -374,9 +375,10 @@ public aspect AxiomElementSupport {
     }
     
     public final void AxiomElement.addNamespaceDeclaration(OMNamespace ns) {
+        AxiomNamespaceDeclaration decl = (AxiomNamespaceDeclaration)coreGetNodeFactory().createNamespaceDeclaration();
+        decl.setDeclaredNamespace(ns);
         try {
-            coreSetAttribute(Policies.NAMESPACE_DECLARATION_MATCHER,
-                    ((AxiomNodeFactory)getOMFactory()).createNamespaceDeclaration(ns),
+            coreSetAttribute(Policies.NAMESPACE_DECLARATION_MATCHER, decl,
                     NodeMigrationPolicy.MOVE_ALWAYS, true, null, ReturnValue.NONE);
         } catch (NodeMigrationException ex) {
             throw AxiomExceptionTranslator.translate(ex);

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactory.java?rev=1700160&r1=1700159&r2=1700160&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactory.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactory.java
Sun Aug 30 20:37:10 2015
@@ -19,10 +19,8 @@
 package org.apache.axiom.om.impl.common.factory;
 
 import org.apache.axiom.core.NodeFactory;
-import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.impl.builder.OMFactoryEx;
-import org.apache.axiom.om.impl.common.AxiomNamespaceDeclaration;
 
 public interface AxiomNodeFactory extends NodeFactory, OMFactoryEx {
-    AxiomNamespaceDeclaration createNamespaceDeclaration(OMNamespace namespace);
+
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java?rev=1700160&r1=1700159&r2=1700160&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
Sun Aug 30 20:37:10 2015
@@ -47,7 +47,6 @@ import org.apache.axiom.om.OMSourcedElem
 import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.impl.common.AxiomElement;
-import org.apache.axiom.om.impl.common.AxiomNamespaceDeclaration;
 import org.apache.axiom.om.impl.common.OMNamespaceImpl;
 import org.apache.axiom.om.impl.common.factory.AxiomNodeFactory;
 import org.apache.axiom.om.impl.dom.CDATASectionImpl;
@@ -306,12 +305,6 @@ public class OMDOMFactory implements Axi
         return new NamespaceDeclaration(this);
     }
 
-    public final AxiomNamespaceDeclaration createNamespaceDeclaration(OMNamespace namespace)
{
-        NamespaceDeclaration decl = new NamespaceDeclaration(this);
-        decl.setDeclaredNamespace(namespace);
-        return decl;
-    }
-
     public final CoreProcessingInstruction createProcessingInstruction() {
         return new ProcessingInstructionImpl(this);
     }

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java?rev=1700160&r1=1700159&r2=1700160&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
Sun Aug 30 20:37:10 2015
@@ -45,7 +45,6 @@ import org.apache.axiom.om.OMSourcedElem
 import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.impl.common.AxiomElement;
-import org.apache.axiom.om.impl.common.AxiomNamespaceDeclaration;
 import org.apache.axiom.om.impl.common.OMNamespaceImpl;
 import org.apache.axiom.om.impl.common.factory.AxiomNodeFactory;
 import org.apache.axiom.om.impl.llom.CDATASectionImpl;
@@ -310,14 +309,7 @@ public class OMLinkedListImplFactory imp
     }
 
     public final CoreNamespaceDeclaration createNamespaceDeclaration() {
-        // TODO
-        throw new UnsupportedOperationException();
-    }
-
-    public final AxiomNamespaceDeclaration createNamespaceDeclaration(OMNamespace namespace)
{
-        NamespaceDeclaration decl = new NamespaceDeclaration(this);
-        decl.setDeclaredNamespace(namespace);
-        return decl;
+        return new NamespaceDeclaration(this);
     }
 
     public CoreProcessingInstruction createProcessingInstruction() {



Mime
View raw message