ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1718771 - in /webservices/axiom/branches/AXIOM-476/aspects: dom-aspects/src/main/java/org/apache/axiom/dom/DOMSemantics.java fom-aspects/src/main/java/org/apache/axiom/fom/FOMSemantics.java
Date Wed, 09 Dec 2015 08:18:22 GMT
Author: veithen
Date: Wed Dec  9 08:18:22 2015
New Revision: 1718771

URL: http://svn.apache.org/viewvc?rev=1718771&view=rev
Log:
Implement the isParentNode method for DOM and FOM.

Modified:
    webservices/axiom/branches/AXIOM-476/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMSemantics.java
    webservices/axiom/branches/AXIOM-476/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/FOMSemantics.java

Modified: webservices/axiom/branches/AXIOM-476/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMSemantics.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-476/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMSemantics.java?rev=1718771&r1=1718770&r2=1718771&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-476/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMSemantics.java
(original)
+++ webservices/axiom/branches/AXIOM-476/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMSemantics.java
Wed Dec  9 08:18:22 2015
@@ -18,6 +18,9 @@
  */
 package org.apache.axiom.dom;
 
+import java.util.EnumSet;
+import java.util.Set;
+
 import org.apache.axiom.core.AttributeMatcher;
 import org.apache.axiom.core.ClonePolicy;
 import org.apache.axiom.core.CoreAttribute;
@@ -31,6 +34,12 @@ import org.apache.axiom.core.NodeType;
 import org.apache.axiom.core.Semantics;
 
 public final class DOMSemantics implements Semantics {
+    private static final Set<NodeType> parentNodeTypes = EnumSet.of(
+            NodeType.DOCUMENT,
+            NodeType.NS_AWARE_ELEMENT,
+            NodeType.NS_UNAWARE_ELEMENT,
+            NodeType.DOCUMENT_FRAGMENT);
+    
     public static final DOMSemantics INSTANCE = new DOMSemantics();
     
     private DOMSemantics() {}
@@ -43,6 +52,10 @@ public final class DOMSemantics implemen
         return false;
     }
 
+    public boolean isParentNode(NodeType nodeType) {
+        return parentNodeTypes.contains(nodeType);
+    }
+
     /**
      * {@link AttributeMatcher} implementation that matches attributes based on their name,
i.e.
      * based on the prefix and local name for namespace aware attributes. Parameters are
defined as

Modified: webservices/axiom/branches/AXIOM-476/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/FOMSemantics.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-476/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/FOMSemantics.java?rev=1718771&r1=1718770&r2=1718771&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-476/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/FOMSemantics.java
(original)
+++ webservices/axiom/branches/AXIOM-476/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/FOMSemantics.java
Wed Dec  9 08:18:22 2015
@@ -21,6 +21,7 @@ package org.apache.axiom.fom;
 import org.apache.axiom.core.AttributeMatcher;
 import org.apache.axiom.core.DetachPolicy;
 import org.apache.axiom.core.NSAwareAttributeMatcher;
+import org.apache.axiom.core.NodeType;
 import org.apache.axiom.core.Semantics;
 
 public final class FOMSemantics implements Semantics {
@@ -36,5 +37,10 @@ public final class FOMSemantics implemen
         return true;
     }
 
+    public boolean isParentNode(NodeType nodeType) {
+        // We don't use Axis.DESCENDANTS(_OR_SELF) anywhere
+        throw new UnsupportedOperationException();
+    }
+
     public static final AttributeMatcher ATTRIBUTE_MATCHER = new NSAwareAttributeMatcher(INSTANCE,
false, false);
 }



Mime
View raw message