ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1696857 - in /webservices/axiom/trunk: aspects/core-aspects/src/main/java/org/apache/axiom/core/ aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/ aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/ ...
Date Thu, 20 Aug 2015 21:28:16 GMT
Author: veithen
Date: Thu Aug 20 21:28:15 2015
New Revision: 1696857

URL: http://svn.apache.org/r1696857
Log:
Streamline the NodeFactory API.

Modified:
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactory.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFactorySupport.aj
    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/core-aspects/src/main/java/org/apache/axiom/core/NodeFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactory.java?rev=1696857&r1=1696856&r2=1696857&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactory.java
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactory.java
Thu Aug 20 21:28:15 2015
@@ -23,7 +23,6 @@ public interface NodeFactory {
     CoreDocumentTypeDeclaration createDocumentTypeDeclaration();
     CoreCharacterDataNode createCharacterDataNode();
     CoreCDATASection createCDATASection();
-    CoreNSAwareElement createNSAwareElement();
     <T extends CoreNSAwareElement> T createNSAwareElement(Class<T> type);
     CoreNSUnawareAttribute createAttribute(CoreDocument document, String name, String value,
String type);
     CoreNSAwareAttribute createAttribute(CoreDocument document, String namespaceURI, String
localName, String prefix, String value, String type);

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj?rev=1696857&r1=1696856&r2=1696857&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj
Thu Aug 20 21:28:15 2015
@@ -25,7 +25,6 @@ import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMDocType;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMProcessingInstruction;
@@ -188,29 +187,9 @@ public aspect AxiomNodeFactorySupport {
         return createOMElement(localName, ns, null);
     }
 
-    public final OMElement AxiomNodeFactory.createOMElement(String localName, OMNamespace
ns, OMContainer parent) {
-        AxiomElement element = (AxiomElement)createNSAwareElement();
-        if (parent != null) {
-            parent.addChild(element);
-        }
-        element.initName(localName, ns, true);
-        return element;
-    }
-
-    public final OMElement AxiomNodeFactory.createOMElement(String localName, OMContainer
parent,
-            OMXMLParserWrapper builder) {
-        AxiomElement element = (AxiomElement)createNSAwareElement();
-        element.coreSetBuilder(builder);
-        if (parent != null) {
-            ((AxiomContainer)parent).addChild(element, true);
-        }
-        element.initName(localName, null, false);
-        return element;
-    }
-
     public final <T extends AxiomElement> T AxiomNodeFactory.createAxiomElement(Class<T>
type,
             OMContainer parent, String localName, OMNamespace ns, OMXMLParserWrapper builder,
-            OMFactory factory, boolean generateNSDecl) {
+            boolean generateNSDecl) {
         T element = createNSAwareElement(type);
         element.coreSetBuilder(builder);
         if (parent != null) {
@@ -219,4 +198,13 @@ public aspect AxiomNodeFactorySupport {
         element.initName(localName, ns, generateNSDecl);
         return element;
     }
+
+    public final OMElement AxiomNodeFactory.createOMElement(String localName, OMNamespace
ns, OMContainer parent) {
+        return createAxiomElement(AxiomElement.class, parent, localName, ns, null, true);
+    }
+
+    public final OMElement AxiomNodeFactory.createOMElement(String localName, OMContainer
parent,
+            OMXMLParserWrapper builder) {
+        return createAxiomElement(AxiomElement.class, parent, localName, null, builder, false);
+    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFactorySupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFactorySupport.aj?rev=1696857&r1=1696856&r2=1696857&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFactorySupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFactorySupport.aj
Thu Aug 20 21:28:15 2015
@@ -35,14 +35,14 @@ public aspect AxiomSOAPFactorySupport {
     }
     
     public final SOAPHeaderBlock AxiomSOAPFactory.createSOAPHeaderBlock(String localName,
OMNamespace ns, SOAPHeader parent) {
-        return createAxiomElement(getSOAPHeaderBlockClass(), parent, localName, ns, null,
this, true);
+        return createAxiomElement(getSOAPHeaderBlockClass(), parent, localName, ns, null,
true);
     }
 
     public final SOAPHeaderBlock AxiomSOAPFactory.createSOAPHeaderBlock(String localName,
OMNamespace ns) {
-        return createAxiomElement(getSOAPHeaderBlockClass(), null, localName, ns, null, this,
true);
+        return createAxiomElement(getSOAPHeaderBlockClass(), null, localName, ns, null, true);
     }
 
     public final SOAPHeaderBlock AxiomSOAPFactory.createSOAPHeaderBlock(String localName,
SOAPHeader parent, OMXMLParserWrapper builder) {
-        return createAxiomElement(getSOAPHeaderBlockClass(), parent, localName, null, builder,
this, false);
+        return createAxiomElement(getSOAPHeaderBlockClass(), parent, localName, null, builder,
false);
     }
 }

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=1696857&r1=1696856&r2=1696857&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
Thu Aug 20 21:28:15 2015
@@ -46,6 +46,7 @@ import org.apache.axiom.om.OMSourcedElem
 import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.impl.OMContainerEx;
 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.Policies;
@@ -293,13 +294,11 @@ public class OMDOMFactory implements Axi
         return new CDATASectionImpl(this);
     }
 
-    public final CoreNSAwareElement createNSAwareElement() {
-        return new ElementImpl(this);
-    }
-
     public final <T extends CoreNSAwareElement> T createNSAwareElement(Class<T>
type) {
         CoreNSAwareElement element;
-        if (type == AxiomSOAP11HeaderBlock.class) {
+        if (type == AxiomElement.class) {
+            element = new ElementImpl(this);
+        } else if (type == AxiomSOAP11HeaderBlock.class) {
             element = new SOAP11HeaderBlockImpl(this);
         } else if (type == AxiomSOAP12HeaderBlock.class) {
             element = new SOAP12HeaderBlockImpl(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=1696857&r1=1696856&r2=1696857&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
Thu Aug 20 21:28:15 2015
@@ -44,6 +44,7 @@ import org.apache.axiom.om.OMProcessingI
 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.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;
@@ -288,13 +289,11 @@ public class OMLinkedListImplFactory imp
         return new CDATASectionImpl(this);
     }
 
-    public final CoreNSAwareElement createNSAwareElement() {
-        return new OMElementImpl(this);
-    }
-
     public final <T extends CoreNSAwareElement> T createNSAwareElement(Class<T>
type) {
         CoreNSAwareElement element;
-        if (type == AxiomSOAP11HeaderBlock.class) {
+        if (type == AxiomElement.class) {
+            element = new OMElementImpl(this);
+        } else if (type == AxiomSOAP11HeaderBlock.class) {
             element = new SOAP11HeaderBlockImpl(this);
         } else if (type == AxiomSOAP12HeaderBlock.class) {
             element = new SOAP12HeaderBlockImpl(this);



Mime
View raw message