abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r589167 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/util/ parser/src/main/java/org/apache/abdera/parser/stax/
Date Sat, 27 Oct 2007 18:23:33 GMT
Author: jmsnell
Date: Sat Oct 27 11:23:32 2007
New Revision: 589167

URL: http://svn.apache.org/viewvc?rev=589167&view=rev
Log:
Additional API cleanups and refactorings

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java?rev=589167&r1=589166&r2=589167&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java Sat
Oct 27 11:23:32 2007
@@ -57,4 +57,16 @@
   public static String normalize(String uri) {
     return normalize(new IRI(uri)).toASCIIString();
   }
+  
+  public static IRI resolve(IRI base, IRI value) {
+    if (value == null) return null;
+    if ("".equals(value.toString()) || 
+        "#".equals(value.toString()) ||
+        ".".equals(value.toString()) ||
+        "./".equals(value.toString())) return base;
+    if (base == null) return value;
+    if ("".equals(base.getPath())) base = base.resolve("/");
+    IRI resolved = (base != null) ? base.resolve(value) : value;
+    return resolved;
+  }
 }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java?rev=589167&r1=589166&r2=589167&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java
Sat Oct 27 11:23:32 2007
@@ -40,7 +40,7 @@
   private static final long serialVersionUID = 5480273546375102411L;
 
   public FOMCategories() {
-    super(CATEGORIES, new FOMDocument(), new FOMFactory());
+    super(CATEGORIES, new FOMDocument<Categories>(), new FOMFactory());
     init();
   }
   

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java?rev=589167&r1=589166&r2=589167&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
Sat Oct 27 11:23:32 2007
@@ -330,15 +330,7 @@
   }
   
   protected IRI _resolve(IRI base, IRI value) {
-    if (value == null) return null;
-    if ("".equals(value.toString()) || 
-        "#".equals(value.toString()) ||
-        ".".equals(value.toString()) ||
-        "./".equals(value.toString())) return base;
-    if (base == null) return value;
-    if ("".equals(base.getPath())) base = base.resolve("/");
-    IRI resolved = (base != null) ? base.resolve(value) : value;
-    return resolved;
+    return URIHelper.resolve(base, value);
   }
 
   public void writeTo(
@@ -832,4 +824,5 @@
   public Iterator<Element> iterator() {
     return getElements().iterator();
   }
+
 }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java?rev=589167&r1=589166&r2=589167&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
Sat Oct 27 11:23:32 2007
@@ -62,7 +62,7 @@
   private static final long serialVersionUID = 1L;
 
   public FOMEntry() {
-    super(Constants.ENTRY, new FOMDocument(), new FOMFactory());
+    super(Constants.ENTRY, new FOMDocument<Entry>(), new FOMFactory());
   }
   
   protected FOMEntry(

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java?rev=589167&r1=589166&r2=589167&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
Sat Oct 27 11:23:32 2007
@@ -46,7 +46,7 @@
   private static final long serialVersionUID = 4552921210185524535L;
   
   public FOMFeed() {
-    super(Constants.FEED, new FOMDocument(), new FOMFactory());
+    super(Constants.FEED, new FOMDocument<Feed>(), new FOMFactory());
   }
   
   protected FOMFeed(

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java?rev=589167&r1=589166&r2=589167&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java
Sat Oct 27 11:23:32 2007
@@ -41,7 +41,7 @@
   private static final long serialVersionUID = 7982751563668891240L;
 
   public FOMService() {
-    super(Constants.SERVICE, new FOMDocument(), new FOMFactory());
+    super(Constants.SERVICE, new FOMDocument<Service>(), new FOMFactory());
     declareAtomNs();
   }
   



Mime
View raw message