ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1608197 - in /webservices/axiom/trunk: ./ modules/axiom-common-impl/ modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/ modules/axiom-dom/ modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ modules/axiom-im...
Date Sun, 06 Jul 2014 13:05:20 GMT
Author: veithen
Date: Sun Jul  6 13:05:19 2014
New Revision: 1608197

URL: http://svn.apache.org/r1608197
Log:
Introduce AspectJ to reduce code duplication and make the code more readable.

Added:
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj
      - copied, changed from r1608084, webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java
Removed:
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java
Modified:
    webservices/axiom/trunk/modules/axiom-common-impl/pom.xml
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeHelper.java
    webservices/axiom/trunk/modules/axiom-dom/pom.xml
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
    webservices/axiom/trunk/modules/axiom-impl/pom.xml
    webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
    webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
    webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
    webservices/axiom/trunk/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMSourcedElementTest.java
    webservices/axiom/trunk/pom.xml
    webservices/axiom/trunk/testsuites/dom-testsuite/pom.xml

Modified: webservices/axiom/trunk/modules/axiom-common-impl/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/pom.xml?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/pom.xml (original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/pom.xml Sun Jul  6 13:05:19 2014
@@ -47,6 +47,10 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjrt</artifactId>
+        </dependency>
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>
@@ -55,6 +59,31 @@
     <build>
         <plugins>
             <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>default-compile</id>
+                        <phase>none</phase>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>aspectj-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                        <configuration>
+                            <complianceLevel>1.5</complianceLevel>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <!-- Note: axiom-common-impl is not intended to be used as an OSGi bundle.
+                     We generate OSGi metadata only for the shading process in axiom-impl
and axiom-dom. -->
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
@@ -62,7 +91,12 @@
                     <excludeDependencies>true</excludeDependencies>
                     <instructions>
                         <Export-Package>*;-noimport:=true</Export-Package>
-                        <Import-Package>*</Import-Package>
+                        <Import-Package>
+                            <!-- aspectjrt is not an OSGi bundle; we don't need to generate
imports because
+                                 axiom-impl and axiom-dom include these classes into the
final JARs -->
+                            !org.aspectj.*,
+                            *
+                        </Import-Package>
                     </instructions>
                 </configuration>
             </plugin>

Copied: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj
(from r1608084, webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj?p2=webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj&p1=webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java&r1=1608084&r2=1608197&rev=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj
Sun Jul  6 13:05:19 2014
@@ -22,6 +22,7 @@ import javax.xml.stream.XMLStreamReader;
 import javax.xml.transform.sax.SAXResult;
 
 import org.apache.axiom.om.NodeUnavailableException;
+import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMSourcedElement;
@@ -38,23 +39,29 @@ import org.apache.axiom.om.util.OMXMLStr
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-public final class OMContainerHelper {
-    private static final Log log = LogFactory.getLog(OMContainerHelper.class);
+public aspect OMContainerSupport {
+    private static final Log log = LogFactory.getLog(OMContainerSupport.class);
     
     private static final OMXMLStreamReaderConfiguration defaultReaderConfiguration = new
OMXMLStreamReaderConfiguration();
     
-    private OMContainerHelper() {}
+    public XMLStreamReader OMContainer.getXMLStreamReader() {
+        return getXMLStreamReader(true);
+    }
     
-    public static XMLStreamReader getXMLStreamReader(IContainer container, boolean cache)
{
-        return getXMLStreamReader(container, cache, defaultReaderConfiguration);
+    public XMLStreamReader OMContainer.getXMLStreamReaderWithoutCaching() {
+        return getXMLStreamReader(false);
+    }
+
+    public XMLStreamReader OMContainer.getXMLStreamReader(boolean cache) {
+        return getXMLStreamReader(cache, defaultReaderConfiguration);
     }
     
-    public static XMLStreamReader getXMLStreamReader(IContainer container, boolean cache,
OMXMLStreamReaderConfiguration configuration) {
-        OMXMLParserWrapper builder = container.getBuilder();
-        if (builder != null && builder.isCompleted() && !cache &&
!container.isComplete()) {
+    public XMLStreamReader IContainer.getXMLStreamReader(boolean cache, OMXMLStreamReaderConfiguration
configuration) {
+        OMXMLParserWrapper builder = getBuilder();
+        if (builder != null && builder.isCompleted() && !cache &&
!isComplete()) {
             throw new UnsupportedOperationException("The parser is already consumed!");
         }
-        OMXMLStreamReader reader = new OMXMLStreamReaderExAdapter(new PullSerializer(container,
cache, configuration.isPreserveNamespaceContext()));
+        OMXMLStreamReader reader = new OMXMLStreamReaderExAdapter(new PullSerializer(this,
cache, configuration.isPreserveNamespaceContext()));
         
         if (configuration.isNamespaceURIInterning()) {
             reader = new NamespaceURIInterningXMLStreamReaderWrapper(reader);
@@ -73,7 +80,7 @@ public final class OMContainerHelper {
         return reader;
     }
     
-    public static void addChild(IContainer container, OMNode omNode, boolean fromBuilder)
{
+    public void IContainer.addChild(OMNode omNode, boolean fromBuilder) {
         OMNodeEx child;
         if (fromBuilder) {
             // If the new child was provided by the builder, we know that it was created
by
@@ -82,35 +89,35 @@ public final class OMContainerHelper {
         } else {
             // Careful here: if the child was created by another Axiom implementation, it
doesn't
             // necessarily implement OMNodeEx
-            if (omNode.getOMFactory().getMetaFactory().equals(container.getOMFactory().getMetaFactory()))
{
+            if (omNode.getOMFactory().getMetaFactory().equals(getOMFactory().getMetaFactory()))
{
                 child = (OMNodeEx)omNode;
             } else {
-                child = (OMNodeEx)((OMFactoryEx)container.getOMFactory()).importNode(omNode);
+                child = (OMNodeEx)((OMFactoryEx)getOMFactory()).importNode(omNode);
             }
-            if (!container.isComplete()) {
-                container.build();
+            if (!isComplete()) {
+                build();
             }
-            if (child.getParent() == container && child == container.getLastKnownOMChild())
{
+            if (child.getParent() == this && child == getLastKnownOMChild()) {
                 // The child is already the last node. 
                 // We don't need to detach and re-add it.
                 return;
             }
-            container.checkChild(omNode);
+            checkChild(omNode);
         }
         if (child.getParent() != null) {
             child.detach();
         }
         
-        child.setParent(container);
+        child.setParent(this);
 
-        if (container.getFirstOMChildIfAvailable() == null) {
-            container.setFirstChild(child);
+        if (getFirstOMChildIfAvailable() == null) {
+            setFirstChild(child);
         } else {
-            OMNode lastChild = container.getLastKnownOMChild();
+            OMNode lastChild = getLastKnownOMChild();
             child.setPreviousOMSibling(lastChild);
             ((OMNodeEx)lastChild).setNextOMSibling(child);
         }
-        container.setLastChild(child);
+        setLastChild(child);
 
         // For a normal OMNode, the incomplete status is
         // propogated up the tree.  
@@ -120,33 +127,33 @@ public final class OMContainerHelper {
         // is a normal OMNode
         if (!fromBuilder && !child.isComplete() && 
             !(child instanceof OMSourcedElement)) {
-            container.setComplete(false);
+            setComplete(false);
         }
     }
     
-    public static void build(IContainer container) {
-        OMXMLParserWrapper builder = container.getBuilder();
-        if (container.getState() == IContainer.DISCARDED) {
+    public void IContainer.defaultBuild() {
+        OMXMLParserWrapper builder = getBuilder();
+        if (getState() == IContainer.DISCARDED) {
             if (builder != null) {
-                ((StAXBuilder)builder).debugDiscarded(container);
+                ((StAXBuilder)builder).debugDiscarded(this);
             }
             throw new NodeUnavailableException();
         }
         if (builder != null && builder.isCompleted()) {
             log.debug("Builder is already complete.");
         }
-        while (!container.isComplete()) {
+        while (!isComplete()) {
 
             builder.next();    
-            if (builder.isCompleted() && !container.isComplete()) {
+            if (builder.isCompleted() && !isComplete()) {
                 log.debug("Builder is complete.  Setting OMObject to complete.");
-                container.setComplete(true);
+                setComplete(true);
             }
         }
     }
     
-    public static void buildNext(IParentNode that) {
-        OMXMLParserWrapper builder = that.getBuilder();
+    public void IParentNode.buildNext() {
+        OMXMLParserWrapper builder = getBuilder();
         if (builder == null) {
             throw new IllegalStateException("The node has no builder");
         } else if (((StAXOMBuilder)builder).isClosed()) {
@@ -160,36 +167,36 @@ public final class OMContainerHelper {
         }         
     }
     
-    public static OMNode getFirstOMChild(IParentNode that) {
-        OMNode firstChild = that.getFirstOMChildIfAvailable();
+    public OMNode IParentNode.getFirstOMChild() {
+        OMNode firstChild = getFirstOMChildIfAvailable();
         if (firstChild == null) {
-            switch (that.getState()) {
+            switch (getState()) {
                 case IParentNode.DISCARDED:
-                    ((StAXBuilder)that.getBuilder()).debugDiscarded(that);
+                    ((StAXBuilder)getBuilder()).debugDiscarded(this);
                     throw new NodeUnavailableException();
                 case IParentNode.INCOMPLETE:
                     do {
-                        buildNext(that);
-                    } while (that.getState() == IParentNode.INCOMPLETE
-                            && (firstChild = that.getFirstOMChildIfAvailable()) ==
null);
+                        buildNext();
+                    } while (getState() == IParentNode.INCOMPLETE
+                            && (firstChild = getFirstOMChildIfAvailable()) == null);
             }
         }
         return firstChild;
     }
     
-    public static void removeChildren(IContainer that) {
+    public void IContainer.removeChildren() {
         boolean updateState;
-        if (that.getState() == IParentNode.INCOMPLETE && that.getBuilder() != null)
{
-            OMNode lastKnownChild = that.getLastKnownOMChild();
+        if (getState() == IParentNode.INCOMPLETE && getBuilder() != null) {
+            OMNode lastKnownChild = getLastKnownOMChild();
             if (lastKnownChild != null) {
                 lastKnownChild.build();
             }
-            ((StAXOMBuilder)that.getBuilder()).discard(that);
+            ((StAXOMBuilder)getBuilder()).discard(this);
             updateState = true;
         } else {
             updateState = false;
         }
-        IChildNode child = (IChildNode)that.getFirstOMChildIfAvailable();
+        IChildNode child = (IChildNode)getFirstOMChildIfAvailable();
         while (child != null) {
             IChildNode nextSibling = (IChildNode)child.getNextOMSiblingIfAvailable();
             child.setPreviousOMSibling(null);
@@ -197,15 +204,15 @@ public final class OMContainerHelper {
             child.setParent(null);
             child = nextSibling;
         }
-        that.setFirstChild(null);
-        that.setLastChild(null);
+        setFirstChild(null);
+        setLastChild(null);
         if (updateState) {
-            that.setComplete(true);
+            setComplete(true);
         }
     }
     
-    public static SAXResult getSAXResult(IContainer that) {
-        SAXResultContentHandler handler = new SAXResultContentHandler(that);
+    public SAXResult OMContainer.getSAXResult() {
+        SAXResultContentHandler handler = new SAXResultContentHandler(this);
         SAXResult result = new SAXResult();
         result.setHandler(handler);
         result.setLexicalHandler(handler);

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeHelper.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeHelper.java?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeHelper.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeHelper.java
Sun Jul  6 13:05:19 2014
@@ -37,7 +37,7 @@ public final class OMNodeHelper {
                         throw new NodeUnavailableException();
                     case IParentNode.INCOMPLETE:
                         do {
-                            OMContainerHelper.buildNext(parent);
+                            parent.buildNext();
                         } while (parent.getState() == IParentNode.INCOMPLETE
                                 && (nextSibling = node.getNextOMSiblingIfAvailable())
== null);
                 }

Modified: webservices/axiom/trunk/modules/axiom-dom/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/pom.xml?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/pom.xml (original)
+++ webservices/axiom/trunk/modules/axiom-dom/pom.xml Sun Jul  6 13:05:19 2014
@@ -105,6 +105,35 @@
     <build>
         <plugins>
             <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>default-compile</id>
+                        <phase>none</phase>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>aspectj-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                        <configuration>
+                            <complianceLevel>1.5</complianceLevel>
+                            <aspectLibraries>
+                                <aspectLibrary>
+                                    <groupId>${project.groupId}</groupId>
+                                    <artifactId>axiom-common-impl</artifactId>
+                                </aspectLibrary>
+                            </aspectLibraries>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
@@ -128,6 +157,7 @@
                             <artifactSet>
                                 <includes>
                                     <include>${project.groupId}:axiom-common-impl</include>
+                                    <include>org.aspectj:aspectjrt</include>
                                 </includes>
                             </artifactSet>
                             <transformers>

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java
Sun Jul  6 13:05:19 2014
@@ -25,7 +25,6 @@ import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.impl.common.IContainer;
-import org.apache.axiom.om.impl.common.OMContainerHelper;
 import org.apache.axiom.om.impl.common.serializer.push.Serializer;
 import org.w3c.dom.DocumentFragment;
 import org.w3c.dom.Node;
@@ -120,11 +119,6 @@ public class DocumentFragmentImpl extend
         return null;
     }
 
-    // TODO: we really shouldn't implement IContainer, but only IParentNode
-    public void removeChildren() {
-        OMContainerHelper.removeChildren(this);
-    }
-
     public final String lookupNamespaceURI(String specifiedPrefix) {
         return null;
     }

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
Sun Jul  6 13:05:19 2014
@@ -31,7 +31,6 @@ import org.apache.axiom.om.dom.DOMMetaFa
 import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
 import org.apache.axiom.om.impl.OMNodeEx;
 import org.apache.axiom.om.impl.common.IDocument;
-import org.apache.axiom.om.impl.common.OMContainerHelper;
 import org.apache.axiom.om.impl.common.OMDocumentHelper;
 import org.apache.axiom.om.impl.common.OMNamespaceImpl;
 import org.apache.axiom.om.impl.common.serializer.push.OutputException;
@@ -595,17 +594,13 @@ public class DocumentImpl extends RootNo
     }
 
     public final void build() {
-        OMContainerHelper.build(this);
+        defaultBuild();
     }
 
     public final Node getNextSibling() {
         return null;
     }
     
-    public final void removeChildren() {
-        OMContainerHelper.removeChildren(this);
-    }
-
     public final String lookupNamespaceURI(String specifiedPrefix) {
         Element documentElement = getDocumentElement();
         return documentElement == null ? null

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
Sun Jul  6 13:05:19 2014
@@ -29,11 +29,11 @@ import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.common.IContainer;
 import org.apache.axiom.om.impl.common.IElement;
 import org.apache.axiom.om.impl.common.IParentNode;
 import org.apache.axiom.om.impl.common.NamespaceIterator;
 import org.apache.axiom.om.impl.common.OMChildElementIterator;
-import org.apache.axiom.om.impl.common.OMContainerHelper;
 import org.apache.axiom.om.impl.common.OMElementHelper;
 import org.apache.axiom.om.impl.common.OMNamedInformationItemHelper;
 import org.apache.axiom.om.impl.common.OMNamespaceImpl;
@@ -108,7 +108,7 @@ public class ElementImpl extends ParentN
         this.builder = builder;
         state = builder == null ? COMPLETE : INCOMPLETE;
         if (parentNode != null) {
-            parentNode.addChild(this, builder != null);
+            ((IContainer)parentNode).addChild(this, builder != null);
         }
         this.attributes = new AttributeMap(this);
         namespace = generateNSDecl ? OMNamedInformationItemHelper.handleNamespace(this, ns,
false, true) : ns;
@@ -1118,7 +1118,7 @@ public class ElementImpl extends ParentN
     }
 
     public final void build() {
-        OMContainerHelper.build(this);
+        defaultBuild();
     }
 
     public final OMNode getNextOMSibling() throws OMException {
@@ -1133,10 +1133,6 @@ public class ElementImpl extends ParentN
         return parentNode();
     }
     
-    public final void removeChildren() {
-        OMContainerHelper.removeChildren(this);
-    }
-
     public final String lookupNamespaceURI(String specifiedPrefix) {
         String namespace = this.getNamespaceURI();
         String prefix = this.getPrefix();

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
Sun Jul  6 13:05:19 2014
@@ -26,14 +26,12 @@ import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMSourcedElement;
-import org.apache.axiom.om.OMXMLStreamReaderConfiguration;
 import org.apache.axiom.om.impl.OMNodeEx;
 import org.apache.axiom.om.impl.common.IContainer;
 import org.apache.axiom.om.impl.common.IParentNode;
 import org.apache.axiom.om.impl.common.OMChildrenLocalNameIterator;
 import org.apache.axiom.om.impl.common.OMChildrenNamespaceIterator;
 import org.apache.axiom.om.impl.common.OMChildrenQNameIterator;
-import org.apache.axiom.om.impl.common.OMContainerHelper;
 import org.apache.axiom.om.impl.common.OMDescendantsIterator;
 import org.apache.axiom.om.impl.common.serializer.push.sax.XMLReaderImpl;
 import org.apache.axiom.om.impl.traverse.OMChildrenIterator;
@@ -47,8 +45,6 @@ import org.w3c.dom.NodeList;
 import org.xml.sax.InputSource;
 
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.transform.sax.SAXResult;
 import javax.xml.transform.sax.SAXSource;
 
 import java.util.Iterator;
@@ -72,11 +68,7 @@ public abstract class ParentNode extends
     }
     
     public void addChild(OMNode omNode) {
-        addChild(omNode, false);
-    }
-
-    public void addChild(OMNode omNode, boolean fromBuilder) {
-        OMContainerHelper.addChild((IContainer)this, omNode, fromBuilder);
+        ((IContainer)this).addChild(omNode, false);
     }
 
     public Iterator getChildren() {
@@ -127,10 +119,6 @@ public abstract class ParentNode extends
         return null;
     }
 
-    public OMNode getFirstOMChild() {
-        return OMContainerHelper.getFirstOMChild(this);
-    }
-
     public OMNode getFirstOMChildIfAvailable() {
         return (OMNode)firstChild;
     }
@@ -526,30 +514,10 @@ public abstract class ParentNode extends
         }
     }
 
-    public XMLStreamReader getXMLStreamReaderWithoutCaching() {
-        return getXMLStreamReader(false);
-    }
-
-    public XMLStreamReader getXMLStreamReader() {
-        return getXMLStreamReader(true);
-    }
-
-    public XMLStreamReader getXMLStreamReader(boolean cache) {
-        return OMContainerHelper.getXMLStreamReader((IContainer)this, cache);
-    }
-    
-    public XMLStreamReader getXMLStreamReader(boolean cache, OMXMLStreamReaderConfiguration
configuration) {
-        return OMContainerHelper.getXMLStreamReader((IContainer)this, cache, configuration);
-    }
-
     public SAXSource getSAXSource(boolean cache) {
         return new SAXSource(new XMLReaderImpl((IContainer)this, cache), new InputSource());
     }
 
-    public SAXResult getSAXResult() {
-        return OMContainerHelper.getSAXResult((IContainer)this);
-    }
-    
     void notifyChildComplete() {
         if (!this.isComplete() && getBuilder() == null) {
             Iterator iterator = getChildren();

Modified: webservices/axiom/trunk/modules/axiom-impl/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/pom.xml?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-impl/pom.xml (original)
+++ webservices/axiom/trunk/modules/axiom-impl/pom.xml Sun Jul  6 13:05:19 2014
@@ -99,6 +99,35 @@
     <build>
         <plugins>
             <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>default-compile</id>
+                        <phase>none</phase>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>aspectj-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                        <configuration>
+                            <complianceLevel>1.5</complianceLevel>
+                            <aspectLibraries>
+                                <aspectLibrary>
+                                    <groupId>${project.groupId}</groupId>
+                                    <artifactId>axiom-common-impl</artifactId>
+                                </aspectLibrary>
+                            </aspectLibraries>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
@@ -122,6 +151,7 @@
                             <artifactSet>
                                 <includes>
                                     <include>${project.groupId}:axiom-common-impl</include>
+                                    <include>org.aspectj:aspectjrt</include>
                                 </includes>
                             </artifactSet>
                             <transformers>

Modified: webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
(original)
+++ webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
Sun Jul  6 13:05:19 2014
@@ -28,12 +28,10 @@ import org.apache.axiom.om.OMInformation
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.OMXMLParserWrapper;
-import org.apache.axiom.om.OMXMLStreamReaderConfiguration;
 import org.apache.axiom.om.impl.common.IDocument;
 import org.apache.axiom.om.impl.common.OMChildrenLocalNameIterator;
 import org.apache.axiom.om.impl.common.OMChildrenNamespaceIterator;
 import org.apache.axiom.om.impl.common.OMChildrenQNameIterator;
-import org.apache.axiom.om.impl.common.OMContainerHelper;
 import org.apache.axiom.om.impl.common.OMDescendantsIterator;
 import org.apache.axiom.om.impl.common.OMDocumentHelper;
 import org.apache.axiom.om.impl.common.serializer.push.OutputException;
@@ -43,8 +41,6 @@ import org.apache.axiom.om.impl.traverse
 import org.xml.sax.InputSource;
 
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.transform.sax.SAXResult;
 import javax.xml.transform.sax.SAXSource;
 
 import java.util.Iterator;
@@ -150,10 +146,6 @@ public class OMDocumentImpl extends OMSe
         addChild(child, false);
     }
 
-    public void addChild(OMNode omNode, boolean fromBuilder) {
-        OMContainerHelper.addChild(this, omNode, fromBuilder);
-    }
-
     public final void checkChild(OMNode child) {
         if (child instanceof OMElement) {
             if (getOMDocumentElement() != null) {
@@ -204,14 +196,6 @@ public class OMDocumentImpl extends OMSe
         return new OMChildrenNamespaceIterator(getFirstOMChild(),
                                                uri);
     }
-    /**
-     * Method getFirstOMChild.
-     *
-     * @return Returns first om child.
-     */
-    public OMNode getFirstOMChild() {
-        return OMContainerHelper.getFirstOMChild(this);
-    }
 
     public OMNode getFirstOMChildIfAvailable() {
         return firstChild;
@@ -300,22 +284,6 @@ public class OMDocumentImpl extends OMSe
         OMDocumentHelper.internalSerialize(this, serializer, format, cache, includeXMLDeclaration);
     }
 
-    public XMLStreamReader getXMLStreamReader() {
-        return getXMLStreamReader(true);
-    }
-
-    public XMLStreamReader getXMLStreamReaderWithoutCaching() {
-        return getXMLStreamReader(false);
-    }
-
-    public XMLStreamReader getXMLStreamReader(boolean cache) {
-        return OMContainerHelper.getXMLStreamReader(this, cache);
-    }
-
-    public XMLStreamReader getXMLStreamReader(boolean cache, OMXMLStreamReaderConfiguration
configuration) {
-        return OMContainerHelper.getXMLStreamReader(this, cache, configuration);
-    }
-
     void notifyChildComplete() {
         if (state == INCOMPLETE && builder == null) {
             Iterator iterator = getChildren();
@@ -333,18 +301,10 @@ public class OMDocumentImpl extends OMSe
         return new SAXSource(new XMLReaderImpl(this, cache), new InputSource());
     }
 
-    public SAXResult getSAXResult() {
-        return OMContainerHelper.getSAXResult(this);
-    }
-    
     public void build() {
-        OMContainerHelper.build(this);
+        defaultBuild();
     }
     
-    public void removeChildren() {
-        OMContainerHelper.removeChildren(this);
-    }
-
     public OMInformationItem clone(OMCloneOptions options) {
         OMDocument targetDocument;
         if (options.isPreserveModel()) {

Modified: webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
(original)
+++ webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
Sun Jul  6 13:05:19 2014
@@ -30,7 +30,6 @@ import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.OMXMLParserWrapper;
-import org.apache.axiom.om.OMXMLStreamReaderConfiguration;
 import org.apache.axiom.om.impl.OMNodeEx;
 import org.apache.axiom.om.impl.common.IContainer;
 import org.apache.axiom.om.impl.common.IElement;
@@ -40,12 +39,10 @@ import org.apache.axiom.om.impl.common.O
 import org.apache.axiom.om.impl.common.OMChildrenLocalNameIterator;
 import org.apache.axiom.om.impl.common.OMChildrenNamespaceIterator;
 import org.apache.axiom.om.impl.common.OMChildrenQNameIterator;
-import org.apache.axiom.om.impl.common.OMContainerHelper;
 import org.apache.axiom.om.impl.common.OMDescendantsIterator;
 import org.apache.axiom.om.impl.common.OMElementHelper;
 import org.apache.axiom.om.impl.common.OMNamedInformationItemHelper;
 import org.apache.axiom.om.impl.common.OMNamespaceImpl;
-import org.apache.axiom.om.impl.common.SAXResultContentHandler;
 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.common.serializer.push.sax.XMLReaderImpl;
@@ -60,9 +57,7 @@ import org.xml.sax.InputSource;
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.sax.SAXResult;
 import javax.xml.transform.sax.SAXSource;
 
 import java.io.IOException;
@@ -205,10 +200,6 @@ public class OMElementImpl extends OMNod
         addChild(omNode, false);
     }
 
-    public void addChild(OMNode omNode, boolean fromBuilder) {
-        OMContainerHelper.addChild(this, omNode, fromBuilder);
-    }
-
     public void checkChild(OMNode child) {
     }
 
@@ -618,15 +609,6 @@ public class OMElementImpl extends OMNod
         return builder;
     }
 
-    /**
-     * Method getFirstOMChild.
-     *
-     * @return Returns child.
-     */
-    public OMNode getFirstOMChild() {
-        return OMContainerHelper.getFirstOMChild(this);
-    }
-
     public OMNode getFirstOMChildIfAvailable() {
         return firstChild;
     }
@@ -676,7 +658,7 @@ public class OMElementImpl extends OMNod
                 omNode.build();
             }
         } else {
-            OMContainerHelper.build(this);
+            defaultBuild();
         }
 
     }
@@ -706,22 +688,6 @@ public class OMElementImpl extends OMNod
         state = DISCARDED;
     }
 
-    public XMLStreamReader getXMLStreamReader() {
-        return getXMLStreamReader(true);
-    }
-
-    public XMLStreamReader getXMLStreamReaderWithoutCaching() {
-        return getXMLStreamReader(false);
-    }
-
-    public XMLStreamReader getXMLStreamReader(boolean cache) {
-        return OMContainerHelper.getXMLStreamReader(this, cache);
-    }
-
-    public XMLStreamReader getXMLStreamReader(boolean cache, OMXMLStreamReaderConfiguration
configuration) {
-        return OMContainerHelper.getXMLStreamReader(this, cache, configuration);
-    }
-
     public void setText(String text) {
         // Remove all existing children
         OMNode child;
@@ -999,13 +965,5 @@ public class OMElementImpl extends OMNod
     public SAXSource getSAXSource(boolean cache) {
         return new SAXSource(new XMLReaderImpl(this, cache), new InputSource());
     }
-
-    public SAXResult getSAXResult() {
-        return OMContainerHelper.getSAXResult(this);
-    }
-    
-    public void removeChildren() {
-        OMContainerHelper.removeChildren(this);
-    }
 }
 

Modified: webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
(original)
+++ webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
Sun Jul  6 13:05:19 2014
@@ -1117,4 +1117,12 @@ public class OMSourcedElementImpl extend
         forceExpand();
         super.removeChildren();
     }
+    
+    public void defaultBuild() {
+        super.defaultBuild();
+    }
+    
+    public void buildNext() {
+        super.buildNext();
+    }
 }

Modified: webservices/axiom/trunk/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMSourcedElementTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMSourcedElementTest.java?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMSourcedElementTest.java
(original)
+++ webservices/axiom/trunk/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMSourcedElementTest.java
Sun Jul  6 13:05:19 2014
@@ -33,7 +33,7 @@ public class OMSourcedElementTest extend
         for (int i = 0; i < supmeths.length; i++) {
             Method supmeth = supmeths[i];
             Class[] params = supmeth.getParameterTypes();
-            if (!Modifier.isPrivate(supmeth.getModifiers())) {
+            if (!Modifier.isPrivate(supmeth.getModifiers()) && !supmeth.getName().startsWith("ajc$"))
{
                 for (int j = 0; j < submeths.length; j++) {
                     Method submeth = submeths[j];
                     if (supmeth.getName().equals(submeth.getName())) {

Modified: webservices/axiom/trunk/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/pom.xml?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/pom.xml (original)
+++ webservices/axiom/trunk/pom.xml Sun Jul  6 13:05:19 2014
@@ -371,6 +371,11 @@
                 <artifactId>spring-ws-security</artifactId>
                 <version>2.2.0.RELEASE</version>
             </dependency>
+            <dependency>
+                <groupId>org.aspectj</groupId>
+                <artifactId>aspectjrt</artifactId>
+                <version>1.7.4</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
     <properties>
@@ -571,6 +576,11 @@
                     <version>0.8.0</version>
                 </plugin>
                 <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>aspectj-maven-plugin</artifactId>
+                    <version>1.6</version>
+                </plugin>
+                <plugin>
                     <groupId>org.eclipse.m2e</groupId>
                     <artifactId>lifecycle-mapping</artifactId>
                     <version>1.0.0</version>

Modified: webservices/axiom/trunk/testsuites/dom-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testsuites/dom-testsuite/pom.xml?rev=1608197&r1=1608196&r2=1608197&view=diff
==============================================================================
--- webservices/axiom/trunk/testsuites/dom-testsuite/pom.xml (original)
+++ webservices/axiom/trunk/testsuites/dom-testsuite/pom.xml Sun Jul  6 13:05:19 2014
@@ -62,7 +62,6 @@
         <dependency>
             <groupId>org.aspectj</groupId>
             <artifactId>aspectjrt</artifactId>
-            <version>1.7.4</version>
         </dependency>
         <dependency>
             <groupId>org.ow2.asm</groupId>
@@ -200,7 +199,6 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>aspectj-maven-plugin</artifactId>
-                <version>1.6</version>
                 <executions>
                     <execution>
                         <goals>



Mime
View raw message