abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r421423 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/factory/ extensions/src/main/java/org/apache/abdera/ext/opensearch/ extensions/src/main/java/org/apache/abdera/ext/thread/
Date Wed, 12 Jul 2006 21:39:40 GMT
Author: rooneg
Date: Wed Jul 12 14:39:40 2006
New Revision: 421423

URL: http://svn.apache.org/viewvc?rev=421423&view=rev
Log:
Allow a given ExtensionFactory to support multiple namespaces.

We don't currently have an ExtensionFactory that supports more than one
namespace, but it seems likely that in the future we will want to do so.

[ in core/src/main/java/org/apache/abdera/factory ]

* ExtensionFactory.java
  (ExtensionFactory.getNamespace): Rename to...
  (ExtensionFactory.getNamespaces): This.  Also, return a List<String>,
   not a String.

[ in extensions/src/main/java/org/apache/abdera/ext ]

* thread/ThreadExtensionFactory.java
  (ThreadExtensionFactory.getNamespace): Rename to...
  (ThreadExtensionFactory.getNamespaces): This.  Also build and return a
   list of namespaces.

* opensearch/OpenSearchExtensionFactory.java
  (OpenSearchExtensionFactory.getNamespace): Rename to...
  (OpenSearchExtensionFactory.getNamespaces): This.  Also build and return
   a list of namespaces.

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactory.java
    incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/opensearch/OpenSearchExtensionFactory.java
    incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/ThreadExtensionFactory.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactory.java?rev=421423&r1=421422&r2=421423&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactory.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactory.java
Wed Jul 12 14:39:40 2006
@@ -22,6 +22,8 @@
 import org.apache.abdera.model.Base;
 import org.apache.abdera.model.Element;
 
+import java.util.List;
+
 /**
  * @author James M Snell (jasnell@us.ibm.com)
  * 
@@ -51,14 +53,14 @@
    * Returns true if this extension factory handles the specified namespace
    */
   boolean handlesNamespace(String namespace);
-  
+
   /**
-   * Returns the Namespace URI handled by this Extension Factory. Each
-   * Extension Factory implementation should handle exactly one namespace.
-   * @return The Namespace URI
+   * Returns the Namespace URIs handled by this Extension Factory.
+   *
+   * @return A List of Namespace URIs Supported by this Extension
    */
-  String getNamespace();
-  
+  List<String> getNamespaces();
+
   /**
    * Called by the Factory implementaton to create an instance of the 
    * extension element.  If parent is not null, the new element will 

Modified: incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/opensearch/OpenSearchExtensionFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/opensearch/OpenSearchExtensionFactory.java?rev=421423&r1=421422&r2=421423&view=diff
==============================================================================
--- incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/opensearch/OpenSearchExtensionFactory.java
(original)
+++ incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/opensearch/OpenSearchExtensionFactory.java
Wed Jul 12 14:39:40 2006
@@ -31,6 +31,8 @@
 import org.apache.axiom.om.OMXMLParserWrapper;
 
 import javax.xml.namespace.QName;
+import java.util.List;
+import java.util.ArrayList;
 
 public class OpenSearchExtensionFactory implements ExtensionFactory, FOMExtensionFactory
{
   public boolean handlesNamespace(String ns)
@@ -38,9 +40,11 @@
     return OpenSearchConstants.OPENSEARCH_NS.equals(ns);
   }
 
-  public String getNamespace()
+  public List<String> getNamespaces()
   {
-    return OpenSearchConstants.OPENSEARCH_NS;
+    List<String> lst = new ArrayList<String>();
+    lst.add(OpenSearchConstants.OPENSEARCH_NS);
+    return lst;
   }
 
   @SuppressWarnings("unchecked")

Modified: incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/ThreadExtensionFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/ThreadExtensionFactory.java?rev=421423&r1=421422&r2=421423&view=diff
==============================================================================
--- incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/ThreadExtensionFactory.java
(original)
+++ incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/ThreadExtensionFactory.java
Wed Jul 12 14:39:40 2006
@@ -18,6 +18,8 @@
 package org.apache.abdera.ext.thread;
 
 import javax.xml.namespace.QName;
+import java.util.List;
+import java.util.ArrayList;
 
 import org.apache.abdera.ext.thread.impl.FOMInReplyTo;
 import org.apache.abdera.ext.thread.impl.FOMTotal;
@@ -38,8 +40,10 @@
     return (ThreadConstants.THR_NS.equals(namespace));
   }
 
-  public String getNamespace() {
-    return ThreadConstants.THR_NS;
+  public List<String> getNamespaces() {
+    List<String> lst = new ArrayList<String>();
+    lst.add(ThreadConstants.THR_NS);
+    return lst;
   }
 
   @SuppressWarnings("unchecked")



Mime
View raw message