ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1701142 - in /webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax: FOMLink.java util/FOMElementIteratorWrapper.java util/FOMExtensionIterator.java util/FOMLinkIterator.java
Date Thu, 03 Sep 2015 22:07:43 GMT
Author: veithen
Date: Thu Sep  3 22:07:42 2015
New Revision: 1701142

URL: http://svn.apache.org/r1701142
Log:
Break package cycle.

Modified:
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMLink.java
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMElementIteratorWrapper.java
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMExtensionIterator.java
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMLinkIterator.java

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMLink.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMLink.java?rev=1701142&r1=1701141&r2=1701142&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMLink.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMLink.java
Thu Sep  3 22:07:42 2015
@@ -17,9 +17,6 @@
  */
 package org.apache.abdera.parser.stax;
 
-import java.util.HashMap;
-import java.util.Map;
-
 import javax.activation.MimeType;
 
 import org.apache.abdera.i18n.iri.IRI;
@@ -120,35 +117,6 @@ public class FOMLink extends FOMExtensib
         return this;
     }
 
-    private static final Map<String, String> REL_EQUIVS = new HashMap<String, String>();
-    static {
-        REL_EQUIVS.put(REL_ALTERNATE_IANA, REL_ALTERNATE);
-        REL_EQUIVS.put(REL_CURRENT_IANA, REL_CURRENT);
-        REL_EQUIVS.put(REL_ENCLOSURE_IANA, REL_ENCLOSURE);
-        REL_EQUIVS.put(REL_FIRST_IANA, REL_FIRST);
-        REL_EQUIVS.put(REL_LAST_IANA, REL_LAST);
-        REL_EQUIVS.put(REL_NEXT_IANA, REL_NEXT);
-        REL_EQUIVS.put(REL_PAYMENT_IANA, REL_PAYMENT);
-        REL_EQUIVS.put(REL_PREVIOUS_IANA, REL_PREVIOUS);
-        REL_EQUIVS.put(REL_RELATED_IANA, REL_RELATED);
-        REL_EQUIVS.put(REL_SELF_IANA, REL_SELF);
-        REL_EQUIVS.put(REL_VIA_IANA, REL_VIA);
-        REL_EQUIVS.put(REL_REPLIES_IANA, REL_REPLIES);
-        REL_EQUIVS.put(REL_LICENSE_IANA, REL_LICENSE);
-        REL_EQUIVS.put(REL_EDIT_IANA, REL_EDIT);
-        REL_EQUIVS.put(REL_EDIT_MEDIA_IANA, REL_EDIT_MEDIA);
-        REL_EQUIVS.put(REL_SERVICE_IANA, REL_SERVICE);
-    }
-
-    public static final String getRelEquiv(String val) {
-        try {
-            val = IRI.normalizeString(val);
-        } catch (Exception e) {
-        }
-        String rel = REL_EQUIVS.get(val);
-        return (rel != null) ? rel : val;
-    }
-
     public String getValue() {
         return getText();
     }

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMElementIteratorWrapper.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMElementIteratorWrapper.java?rev=1701142&r1=1701141&r2=1701142&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMElementIteratorWrapper.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMElementIteratorWrapper.java
Thu Sep  3 22:07:42 2015
@@ -20,15 +20,15 @@ package org.apache.abdera.parser.stax.ut
 import java.util.Iterator;
 
 import org.apache.abdera.model.Element;
-import org.apache.abdera.parser.stax.FOMFactory;
+import org.apache.axiom.fom.AbderaFactory;
 
 @SuppressWarnings("unchecked")
 public class FOMElementIteratorWrapper implements Iterator {
 
     private final Iterator<?> iterator;
-    private final FOMFactory factory;
+    private final AbderaFactory factory;
 
-    public FOMElementIteratorWrapper(FOMFactory factory, Iterator<?> iterator) {
+    public FOMElementIteratorWrapper(AbderaFactory factory, Iterator<?> iterator) {
         this.iterator = iterator;
         this.factory = factory;
     }

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMExtensionIterator.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMExtensionIterator.java?rev=1701142&r1=1701141&r2=1701142&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMExtensionIterator.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMExtensionIterator.java
Thu Sep  3 22:07:42 2015
@@ -18,7 +18,7 @@
 package org.apache.abdera.parser.stax.util;
 
 import org.apache.abdera.model.Element;
-import org.apache.abdera.parser.stax.FOMFactory;
+import org.apache.axiom.fom.AbderaFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.impl.traverse.OMFilterIterator;
@@ -32,7 +32,7 @@ public class FOMExtensionIterator extend
      */
     private String namespace = null;
     private String extns = null;
-    private FOMFactory factory = null;
+    private AbderaFactory factory = null;
 
     /**
      * Constructor OMChildrenQNameIterator.
@@ -43,7 +43,7 @@ public class FOMExtensionIterator extend
     public FOMExtensionIterator(OMElement parent) {
         super(parent.getChildren());
         this.namespace = parent.getQName().getNamespaceURI();
-        this.factory = (FOMFactory)parent.getOMFactory();
+        this.factory = (AbderaFactory)parent.getOMFactory();
     }
 
     public FOMExtensionIterator(OMElement parent, String extns) {

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMLinkIterator.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMLinkIterator.java?rev=1701142&r1=1701141&r2=1701142&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMLinkIterator.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/util/FOMLinkIterator.java
Thu Sep  3 22:07:42 2015
@@ -17,16 +17,47 @@
  */
 package org.apache.abdera.parser.stax.util;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.i18n.iri.IRI;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.Link;
-import org.apache.abdera.parser.stax.FOMLink;
 
 public class FOMLinkIterator extends FOMElementIterator {
+    private static final Map<String, String> REL_EQUIVS = new HashMap<String, String>();
+    static {
+        REL_EQUIVS.put(Link.REL_ALTERNATE_IANA, Link.REL_ALTERNATE);
+        REL_EQUIVS.put(Link.REL_CURRENT_IANA, Link.REL_CURRENT);
+        REL_EQUIVS.put(Link.REL_ENCLOSURE_IANA, Link.REL_ENCLOSURE);
+        REL_EQUIVS.put(Link.REL_FIRST_IANA, Link.REL_FIRST);
+        REL_EQUIVS.put(Link.REL_LAST_IANA, Link.REL_LAST);
+        REL_EQUIVS.put(Link.REL_NEXT_IANA, Link.REL_NEXT);
+        REL_EQUIVS.put(Link.REL_PAYMENT_IANA, Link.REL_PAYMENT);
+        REL_EQUIVS.put(Link.REL_PREVIOUS_IANA, Link.REL_PREVIOUS);
+        REL_EQUIVS.put(Link.REL_RELATED_IANA, Link.REL_RELATED);
+        REL_EQUIVS.put(Link.REL_SELF_IANA, Link.REL_SELF);
+        REL_EQUIVS.put(Link.REL_VIA_IANA, Link.REL_VIA);
+        REL_EQUIVS.put(Link.REL_REPLIES_IANA, Link.REL_REPLIES);
+        REL_EQUIVS.put(Link.REL_LICENSE_IANA, Link.REL_LICENSE);
+        REL_EQUIVS.put(Link.REL_EDIT_IANA, Link.REL_EDIT);
+        REL_EQUIVS.put(Link.REL_EDIT_MEDIA_IANA, Link.REL_EDIT_MEDIA);
+        REL_EQUIVS.put(Link.REL_SERVICE_IANA, Link.REL_SERVICE);
+    }
+
+    private static final String getRelEquiv(String val) {
+        try {
+            val = IRI.normalizeString(val);
+        } catch (Exception e) {
+        }
+        String rel = REL_EQUIVS.get(val);
+        return (rel != null) ? rel : val;
+    }
 
     public FOMLinkIterator(Element parent, Class<?> _class, QName attribute, String
value, String defaultValue) {
-        super(parent, _class, attribute, value != null ? FOMLink.getRelEquiv(value) : Link.REL_ALTERNATE,
defaultValue);
+        super(parent, _class, attribute, value != null ? getRelEquiv(value) : Link.REL_ALTERNATE,
defaultValue);
     }
 
     public FOMLinkIterator(Element parent, Class<?> _class) {
@@ -35,7 +66,7 @@ public class FOMLinkIterator extends FOM
 
     protected boolean isMatch(Element el) {
         if (attribute != null) {
-            String val = FOMLink.getRelEquiv(el.getAttributeValue(attribute));
+            String val = getRelEquiv(el.getAttributeValue(attribute));
             return ((val == null && value == null) || (val == null && value
!= null && value
                 .equalsIgnoreCase(defaultValue)) || (val != null && val.equalsIgnoreCase(value)));
         }



Mime
View raw message