Author: veithen
Date: Sun Jul 6 18:31:39 2014
New Revision: 1608275
URL: http://svn.apache.org/r1608275
Log:
More AspectJ changes.
Added:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNode.java
- copied, changed from r1608084,
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IChildNode.java
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNodeSupport.aj
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreParentNode.java
- copied, changed from r1608084,
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IParentNode.java
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreParentNodeSupport.aj
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/INode.java
(with props)
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/InformationItem.java
(with props)
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeSupport.aj
Removed:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IChildNode.java
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IParentNode.java
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeHelper.java
Modified:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IContainer.java
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IElement.java
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMElementHelper.java
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/push/Serializer.java
webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.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/NodeImpl.java
webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
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/OMNodeImpl.java
webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSerializableImpl.java
webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
Copied:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNode.java
(from r1608084,
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IChildNode.java)
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNode.java?p2=webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNode.java&p1=webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IChildNode.java&r1=1608084&r2=1608275&rev=1608275&view=diff
==============================================================================
---
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IChildNode.java
(original)
+++
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNode.java
Sun Jul 6 18:31:39 2014
@@ -20,6 +20,7 @@ package org.apache.axiom.om.impl.common;
import org.apache.axiom.om.impl.OMNodeEx;
-public interface IChildNode extends OMNodeEx, ISerializable {
- IParentNode getIParentNode();
+public interface CoreChildNode extends OMNodeEx, ISerializable {
+ CoreParentNode coreGetParent();
+ CoreChildNode coreGetNextSiblingIfAvailable();
}
Added:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNodeSupport.aj
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNodeSupport.aj?rev=1608275&view=auto
==============================================================================
---
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNodeSupport.aj
(added)
+++
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNodeSupport.aj
Sun Jul 6 18:31:39 2014
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.om.impl.common;
+
+import org.apache.axiom.om.NodeUnavailableException;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.impl.builder.StAXBuilder;
+
+public aspect CoreChildNodeSupport {
+ public CoreChildNode CoreChildNode.coreGetNextSibling() throws OMException
{
+ CoreChildNode nextSibling = coreGetNextSiblingIfAvailable();
+ if (nextSibling == null) {
+ CoreParentNode parent = coreGetParent();
+ if (parent != null && parent.getBuilder() != null) {
+ switch (parent.getState()) {
+ case CoreParentNode.DISCARDED:
+
((StAXBuilder)parent.getBuilder()).debugDiscarded(parent);
+ throw new NodeUnavailableException();
+ case CoreParentNode.INCOMPLETE:
+ do {
+ parent.buildNext();
+ } while (parent.getState() == CoreParentNode.INCOMPLETE
+ && (nextSibling =
coreGetNextSiblingIfAvailable()) == null);
+ }
+ }
+ }
+ return nextSibling;
+ }
+}
Copied:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreParentNode.java
(from r1608084,
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IParentNode.java)
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreParentNode.java?p2=webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreParentNode.java&p1=webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IParentNode.java&r1=1608084&r2=1608275&rev=1608275&view=diff
==============================================================================
---
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IParentNode.java
(original)
+++
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreParentNode.java
Sun Jul 6 18:31:39 2014
@@ -29,7 +29,7 @@ import org.w3c.dom.DocumentFragment;
* as well as nodes that can have children, but that are not {@link
OMContainer} implementations
* (such as DOOM's {@link Attr} and {@link DocumentFragment} implementations).
*/
-public interface IParentNode {
+public interface CoreParentNode {
int INCOMPLETE = 0;
int COMPLETE = 1;
int DISCARDED = 2;
@@ -48,5 +48,5 @@ public interface IParentNode {
* @return the first child or <code>null</code> if the container has no
children or
* the builder has not yet started to build the first child
*/
- public OMNode getFirstOMChildIfAvailable();
+ public CoreChildNode coreGetFirstChildIfAvailable();
}
Added:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreParentNodeSupport.aj
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreParentNodeSupport.aj?rev=1608275&view=auto
==============================================================================
---
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreParentNodeSupport.aj
(added)
+++
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreParentNodeSupport.aj
Sun Jul 6 18:31:39 2014
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.om.impl.common;
+
+import org.apache.axiom.om.NodeUnavailableException;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.builder.StAXBuilder;
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+
+public aspect CoreParentNodeSupport {
+ public void CoreParentNode.buildNext() {
+ OMXMLParserWrapper builder = getBuilder();
+ if (builder == null) {
+ throw new IllegalStateException("The node has no builder");
+ } else if (((StAXOMBuilder)builder).isClosed()) {
+ throw new OMException("The builder has already been closed");
+ } else if (!builder.isCompleted()) {
+ builder.next();
+ } else {
+ // If the builder is suddenly complete, but the completion status
of the node
+ // doesn't change, then this means that we built the wrong nodes
+ throw new IllegalStateException("Builder is already complete");
+ }
+ }
+
+ public CoreChildNode CoreParentNode.coreGetFirstChild() {
+ CoreChildNode firstChild = coreGetFirstChildIfAvailable();
+ if (firstChild == null) {
+ switch (getState()) {
+ case CoreParentNode.DISCARDED:
+ ((StAXBuilder)getBuilder()).debugDiscarded(this);
+ throw new NodeUnavailableException();
+ case CoreParentNode.INCOMPLETE:
+ do {
+ buildNext();
+ } while (getState() == CoreParentNode.INCOMPLETE
+ && (firstChild = coreGetFirstChildIfAvailable())
== null);
+ }
+ }
+ return firstChild;
+ }
+}
Modified:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IContainer.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IContainer.java?rev=1608275&r1=1608274&r2=1608275&view=diff
==============================================================================
---
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IContainer.java
(original)
+++
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IContainer.java
Sun Jul 6 18:31:39 2014
@@ -22,7 +22,7 @@ import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.impl.OMContainerEx;
-public interface IContainer extends OMContainerEx, IParentNode, ISerializable {
+public interface IContainer extends OMContainerEx, CoreParentNode,
ISerializable {
/**
* Check if the node can be added as a child of this container.
*
Modified:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IElement.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IElement.java?rev=1608275&r1=1608274&r2=1608275&view=diff
==============================================================================
---
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IElement.java
(original)
+++
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IElement.java
Sun Jul 6 18:31:39 2014
@@ -21,6 +21,6 @@ package org.apache.axiom.om.impl.common;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.impl.OMElementEx;
-public interface IElement extends OMElementEx, IContainer, IChildNode {
+public interface IElement extends OMElementEx, IContainer, INode {
void addNamespaceDeclaration(OMNamespace ns);
}
Added:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/INode.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/INode.java?rev=1608275&view=auto
==============================================================================
---
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/INode.java
(added)
+++
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/INode.java
Sun Jul 6 18:31:39 2014
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.om.impl.common;
+
+import org.apache.axiom.om.impl.OMNodeEx;
+
+public interface INode extends OMNodeEx, CoreChildNode {
+
+}
Propchange:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/INode.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/InformationItem.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/InformationItem.java?rev=1608275&view=auto
==============================================================================
---
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/InformationItem.java
(added)
+++
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/InformationItem.java
Sun Jul 6 18:31:39 2014
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.om.impl.common;
+
+public class InformationItem {
+
+}
Propchange:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/InformationItem.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj?rev=1608275&r1=1608274&r2=1608275&view=diff
==============================================================================
---
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj
(original)
+++
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj
Sun Jul 6 18:31:39 2014
@@ -45,6 +45,8 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public aspect OMContainerSupport {
+// declare parents: (InformationItem+ && OMContainer+) implements
IContainer;
+
private static final Log log = LogFactory.getLog(OMContainerSupport.class);
private static final OMXMLStreamReaderConfiguration
defaultReaderConfiguration = new OMXMLStreamReaderConfiguration();
@@ -119,7 +121,7 @@ public aspect OMContainerSupport {
child.setParent(this);
- if (getFirstOMChildIfAvailable() == null) {
+ if (coreGetFirstChildIfAvailable() == null) {
setFirstChild(child);
} else {
OMNode lastChild = getLastKnownOMChild();
@@ -161,41 +163,17 @@ public aspect OMContainerSupport {
}
}
- public void IParentNode.buildNext() {
- OMXMLParserWrapper builder = getBuilder();
- if (builder == null) {
- throw new IllegalStateException("The node has no builder");
- } else if (((StAXOMBuilder)builder).isClosed()) {
- throw new OMException("The builder has already been closed");
- } else if (!builder.isCompleted()) {
- builder.next();
- } else {
- // If the builder is suddenly complete, but the completion status
of the node
- // doesn't change, then this means that we built the wrong nodes
- throw new IllegalStateException("Builder is already complete");
- }
- }
-
- public OMNode IParentNode.getFirstOMChild() {
- OMNode firstChild = getFirstOMChildIfAvailable();
- if (firstChild == null) {
- switch (getState()) {
- case IParentNode.DISCARDED:
- ((StAXBuilder)getBuilder()).debugDiscarded(this);
- throw new NodeUnavailableException();
- case IParentNode.INCOMPLETE:
- do {
- buildNext();
- } while (getState() == IParentNode.INCOMPLETE
- && (firstChild = getFirstOMChildIfAvailable()) ==
null);
- }
- }
- return firstChild;
+ public OMNode IContainer.getFirstOMChildIfAvailable() {
+ return (OMNode)coreGetFirstChildIfAvailable();
+ }
+
+ public OMNode IContainer.getFirstOMChild() {
+ return (OMNode)coreGetFirstChild();
}
public void IContainer.removeChildren() {
boolean updateState;
- if (getState() == IParentNode.INCOMPLETE && getBuilder() != null) {
+ if (getState() == CoreParentNode.INCOMPLETE && getBuilder() != null) {
OMNode lastKnownChild = getLastKnownOMChild();
if (lastKnownChild != null) {
lastKnownChild.build();
@@ -205,9 +183,9 @@ public aspect OMContainerSupport {
} else {
updateState = false;
}
- IChildNode child = (IChildNode)getFirstOMChildIfAvailable();
+ CoreChildNode child = coreGetFirstChildIfAvailable();
while (child != null) {
- IChildNode nextSibling =
(IChildNode)child.getNextOMSiblingIfAvailable();
+ CoreChildNode nextSibling =
(CoreChildNode)child.getNextOMSiblingIfAvailable();
child.setPreviousOMSibling(null);
child.setNextOMSibling(null);
child.setParent(null);
Modified:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMElementHelper.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMElementHelper.java?rev=1608275&r1=1608274&r2=1608275&view=diff
==============================================================================
---
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMElementHelper.java
(original)
+++
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMElementHelper.java
Sun Jul 6 18:31:39 2014
@@ -148,7 +148,7 @@ public class OMElementHelper {
}
public static void discard(IElement that) {
- if (that.getState() == IParentNode.INCOMPLETE && that.getBuilder() !=
null) {
+ if (that.getState() == CoreParentNode.INCOMPLETE && that.getBuilder()
!= null) {
((StAXOMBuilder)that.getBuilder()).discard((OMContainer)that);
}
that.detach();
Added:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeSupport.aj
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeSupport.aj?rev=1608275&view=auto
==============================================================================
---
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeSupport.aj
(added)
+++
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeSupport.aj
Sun Jul 6 18:31:39 2014
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.om.impl.common;
+
+import org.apache.axiom.om.OMNode;
+
+public aspect OMNodeSupport {
+ declare parents: (InformationItem+ && OMNode+) implements INode;
+
+ public OMNode INode.getNextOMSiblingIfAvailable() {
+ return (OMNode)coreGetNextSiblingIfAvailable();
+ }
+
+ public OMNode INode.getNextOMSibling() {
+ return (OMNode)coreGetNextSibling();
+ }
+}
Modified:
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/push/Serializer.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/push/Serializer.java?rev=1608275&r1=1608274&r2=1608275&view=diff
==============================================================================
---
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/push/Serializer.java
(original)
+++
webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/push/Serializer.java
Sun Jul 6 18:31:39 2014
@@ -42,7 +42,7 @@ import org.apache.axiom.om.OMOutputForma
import org.apache.axiom.om.OMSerializable;
import org.apache.axiom.om.impl.builder.StAXBuilder;
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.common.IChildNode;
+import org.apache.axiom.om.impl.common.CoreChildNode;
import org.apache.axiom.om.impl.common.IContainer;
import org.apache.axiom.om.impl.common.OMDataSourceUtil;
import org.apache.axiom.util.stax.XMLStreamReaderUtils;
@@ -267,17 +267,17 @@ public abstract class Serializer {
throw new NodeUnavailableException();
}
if (cache) {
- IChildNode child = (IChildNode)container.getFirstOMChild();
+ CoreChildNode child = (CoreChildNode)container.getFirstOMChild();
while (child != null) {
child.internalSerialize(this, format, true);
- child = (IChildNode)child.getNextOMSibling();
+ child = (CoreChildNode)child.getNextOMSibling();
}
} else {
// First, recursively serialize all child nodes that have already
been created
- IChildNode child =
(IChildNode)container.getFirstOMChildIfAvailable();
+ CoreChildNode child =
(CoreChildNode)container.getFirstOMChildIfAvailable();
while (child != null) {
child.internalSerialize(this, format, cache);
- child = (IChildNode)child.getNextOMSiblingIfAvailable();
+ child = (CoreChildNode)child.getNextOMSiblingIfAvailable();
}
// Next, if the container is incomplete, disable caching
(temporarily)
// and serialize the nodes that have not been built yet by copying
the
Modified:
webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java?rev=1608275&r1=1608274&r2=1608275&view=diff
==============================================================================
---
webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
(original)
+++
webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
Sun Jul 6 18:31:39 2014
@@ -21,15 +21,13 @@ package org.apache.axiom.om.impl.dom;
import org.apache.axiom.om.OMCloneOptions;
import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.OMXMLParserWrapper;
-import org.apache.axiom.om.impl.common.IChildNode;
-import org.apache.axiom.om.impl.common.IParentNode;
-import org.apache.axiom.om.impl.common.OMNodeHelper;
+import org.apache.axiom.om.impl.common.CoreChildNode;
+import org.apache.axiom.om.impl.common.CoreParentNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-public abstract class ChildNode extends NodeImpl implements IChildNode {
+public abstract class ChildNode extends NodeImpl implements CoreChildNode {
private ParentNode ownerNode;
private NodeImpl previousSibling;
@@ -64,6 +62,10 @@ public abstract class ChildNode extends
this.nextSibling = nextSibling;
}
+ public final CoreChildNode coreGetNextSiblingIfAvailable() {
+ return (CoreChildNode)nextSibling;
+ }
+
final NodeImpl clone(OMCloneOptions options, ParentNode targetParent,
boolean deep, boolean namespaceRepairing) {
beforeClone(options);
ChildNode clone = createClone();
@@ -101,15 +103,11 @@ public abstract class ChildNode extends
// Do nothing; a leaf node is always complete
}
- public final OMNode getNextOMSibling() throws OMException {
- return OMNodeHelper.getNextOMSibling(this);
- }
-
public final Node getNextSibling() {
- return (Node)getNextOMSibling();
+ return (Node)coreGetNextSibling();
}
- public final IParentNode getIParentNode() {
+ public final CoreParentNode coreGetParent() {
return parentNode();
}
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=1608275&r1=1608274&r2=1608275&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 18:31:39 2014
@@ -29,15 +29,15 @@ 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.CoreChildNode;
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.CoreParentNode;
import org.apache.axiom.om.impl.common.NamespaceIterator;
import org.apache.axiom.om.impl.common.OMChildElementIterator;
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.OMNodeHelper;
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.EmptyIterator;
@@ -138,6 +138,10 @@ public class ElementImpl extends ParentN
this.nextSibling = nextSibling;
}
+ public final CoreChildNode coreGetNextSiblingIfAvailable() {
+ return (CoreChildNode)nextSibling;
+ }
+
OMNamespace handleNamespace(String namespaceURI, String prefix) {
if (prefix.length() == 0 && namespaceURI.length() == 0) {
OMNamespace namespace = getDefaultNamespace();
@@ -1121,15 +1125,11 @@ public class ElementImpl extends ParentN
defaultBuild();
}
- public final OMNode getNextOMSibling() throws OMException {
- return OMNodeHelper.getNextOMSibling(this);
- }
-
public final Node getNextSibling() {
- return (Node)getNextOMSibling();
+ return (Node)coreGetNextSibling();
}
- public final IParentNode getIParentNode() {
+ public final CoreParentNode coreGetParent() {
return parentNode();
}
Modified:
webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java?rev=1608275&r1=1608274&r2=1608275&view=diff
==============================================================================
---
webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
(original)
+++
webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
Sun Jul 6 18:31:39 2014
@@ -31,6 +31,7 @@ import org.apache.axiom.om.OMXMLParserWr
import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
import org.apache.axiom.om.impl.OMNodeEx;
import org.apache.axiom.om.impl.builder.StAXBuilder;
+import org.apache.axiom.om.impl.common.InformationItem;
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.stax.StAXSerializer;
@@ -49,7 +50,7 @@ import java.util.Hashtable;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
-public abstract class NodeImpl implements Node {
+public abstract class NodeImpl extends InformationItem implements Node {
/** Holds the user data objects */
private Hashtable userData; // Will be initialized in setUserData()
@@ -495,10 +496,6 @@ public abstract class NodeImpl implement
return hasParent() ? internalGetOwnerNode() : null;
}
- public final OMNode getNextOMSiblingIfAvailable() {
- return (OMNode)internalGetNextSibling();
- }
-
public final OMNode getPreviousOMSibling() {
return (OMNode)internalGetPreviousSibling();
}
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=1608275&r1=1608274&r2=1608275&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 18:31:39 2014
@@ -25,8 +25,9 @@ import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.OMSourcedElement;
import org.apache.axiom.om.impl.OMNodeEx;
+import org.apache.axiom.om.impl.common.CoreChildNode;
import org.apache.axiom.om.impl.common.IContainer;
-import org.apache.axiom.om.impl.common.IParentNode;
+import org.apache.axiom.om.impl.common.CoreParentNode;
import org.apache.axiom.om.impl.common.serializer.push.sax.XMLReaderImpl;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
@@ -36,7 +37,7 @@ import org.xml.sax.InputSource;
import javax.xml.transform.sax.SAXSource;
-public abstract class ParentNode extends NodeImpl implements NodeList,
IParentNode {
+public abstract class ParentNode extends NodeImpl implements NodeList,
CoreParentNode {
protected NodeImpl firstChild;
@@ -54,8 +55,8 @@ public abstract class ParentNode extends
insertBefore(node, null, false);
}
- public OMNode getFirstOMChildIfAvailable() {
- return (OMNode)firstChild;
+ public CoreChildNode coreGetFirstChildIfAvailable() {
+ return (CoreChildNode)firstChild;
}
public OMNode getLastKnownOMChild() {
@@ -110,7 +111,7 @@ public abstract class ParentNode extends
}
public Node getFirstChild() {
- return (Node) this.getFirstOMChild();
+ return (Node)coreGetFirstChild();
}
public Node getLastChild() {
@@ -453,10 +454,10 @@ public abstract class ParentNode extends
}
void normalize(DOMConfigurationImpl config) {
- OMNode child = getFirstOMChild();
+ CoreChildNode child = coreGetFirstChild();
while (child != null) {
((NodeImpl)child).normalize(config);
- child = child.getNextOMSibling();
+ child = child.coreGetNextSibling();
}
}
}
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=1608275&r1=1608274&r2=1608275&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 18:31:39 2014
@@ -28,8 +28,8 @@ 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.impl.common.CoreChildNode;
import org.apache.axiom.om.impl.common.IDocument;
-import org.apache.axiom.om.impl.common.OMChildrenQNameIterator;
import org.apache.axiom.om.impl.common.OMDocumentHelper;
import org.apache.axiom.om.impl.common.serializer.push.OutputException;
import org.apache.axiom.om.impl.common.serializer.push.Serializer;
@@ -150,8 +150,8 @@ public class OMDocumentImpl extends OMSe
protected void checkDocumentElement(OMElement element) {
}
- public OMNode getFirstOMChildIfAvailable() {
- return firstChild;
+ public CoreChildNode coreGetFirstChildIfAvailable() {
+ return (CoreChildNode)firstChild;
}
public OMNode getLastKnownOMChild() {
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=1608275&r1=1608274&r2=1608275&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 18:31:39 2014
@@ -31,6 +31,7 @@ import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.OMOutputFormat;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.impl.OMNodeEx;
+import org.apache.axiom.om.impl.common.CoreChildNode;
import org.apache.axiom.om.impl.common.IContainer;
import org.apache.axiom.om.impl.common.IElement;
import org.apache.axiom.om.impl.common.NamespaceIterator;
@@ -523,8 +524,8 @@ public class OMElementImpl extends OMNod
return builder;
}
- public OMNode getFirstOMChildIfAvailable() {
- return firstChild;
+ public CoreChildNode coreGetFirstChildIfAvailable() {
+ return (CoreChildNode)firstChild;
}
public OMNode getLastKnownOMChild() {
Modified:
webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java?rev=1608275&r1=1608274&r2=1608275&view=diff
==============================================================================
---
webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
(original)
+++
webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
Sun Jul 6 18:31:39 2014
@@ -27,14 +27,13 @@ import org.apache.axiom.om.OMInformation
import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.impl.OMNodeEx;
import org.apache.axiom.om.impl.builder.OMFactoryEx;
-import org.apache.axiom.om.impl.common.IChildNode;
+import org.apache.axiom.om.impl.common.CoreChildNode;
import org.apache.axiom.om.impl.common.IContainer;
-import org.apache.axiom.om.impl.common.IParentNode;
-import org.apache.axiom.om.impl.common.OMNodeHelper;
+import org.apache.axiom.om.impl.common.CoreParentNode;
import org.apache.axiom.om.impl.llom.factory.OMLinkedListImplFactory;
/** Class OMNodeImpl */
-public abstract class OMNodeImpl extends OMSerializableImpl implements
IChildNode {
+public abstract class OMNodeImpl extends OMSerializableImpl implements OMNode {
/** Field parent */
protected IContainer parent;
@@ -64,7 +63,7 @@ public abstract class OMNodeImpl extends
return parent;
}
- public IParentNode getIParentNode() {
+ public CoreParentNode coreGetParent() {
return parent;
}
@@ -92,18 +91,7 @@ public abstract class OMNodeImpl extends
}
}
- /**
- * Returns the next sibling. This can be an OMAttribute or OMText or
OMElement for others.
- *
- * @return Returns OMNode.
- * @throws org.apache.axiom.om.OMException
- *
- */
- public OMNode getNextOMSibling() throws OMException {
- return OMNodeHelper.getNextOMSibling(this);
- }
-
- public OMNode getNextOMSiblingIfAvailable() {
+ public CoreChildNode coreGetNextSiblingIfAvailable() {
return nextSibling;
}
Modified:
webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSerializableImpl.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSerializableImpl.java?rev=1608275&r1=1608274&r2=1608275&view=diff
==============================================================================
---
webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSerializableImpl.java
(original)
+++
webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSerializableImpl.java
Sun Jul 6 18:31:39 2014
@@ -31,6 +31,7 @@ import org.apache.axiom.om.OMXMLParserWr
import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
import org.apache.axiom.om.impl.builder.StAXBuilder;
import org.apache.axiom.om.impl.common.ISerializable;
+import org.apache.axiom.om.impl.common.InformationItem;
import org.apache.axiom.om.impl.common.serializer.push.OutputException;
import org.apache.axiom.om.impl.common.serializer.push.stax.StAXSerializer;
import org.apache.axiom.om.util.StAXUtils;
@@ -38,7 +39,7 @@ import org.apache.axiom.soap.impl.builde
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-public abstract class OMSerializableImpl implements ISerializable {
+public abstract class OMSerializableImpl extends InformationItem implements
ISerializable {
private static final Log log = LogFactory.getLog(OMSerializableImpl.class);
protected OMFactory factory;
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=1608275&r1=1608274&r2=1608275&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 18:31:39 2014
@@ -36,6 +36,8 @@ import org.apache.axiom.om.OMXMLParserWr
import org.apache.axiom.om.OMXMLStreamReaderConfiguration;
import org.apache.axiom.om.QNameAwareOMDataSource;
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.impl.common.CoreChildNode;
+import org.apache.axiom.om.impl.common.CoreParentNode;
import org.apache.axiom.om.impl.common.OMDataSourceUtil;
import org.apache.axiom.om.impl.common.OMNamespaceImpl;
import org.apache.axiom.om.impl.common.serializer.push.OutputException;
@@ -1125,4 +1127,20 @@ public class OMSourcedElementImpl extend
public void buildNext() {
super.buildNext();
}
+
+ public CoreParentNode coreGetParent() {
+ return super.coreGetParent();
+ }
+
+ public CoreChildNode coreGetNextSiblingIfAvailable() {
+ return super.coreGetNextSiblingIfAvailable();
+ }
+
+ public CoreChildNode coreGetFirstChild() {
+ return super.coreGetFirstChild();
+ }
+
+ public CoreChildNode coreGetFirstChildIfAvailable() {
+ return super.coreGetFirstChildIfAvailable();
+ }
}