jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1136501 - /jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java
Date Thu, 16 Jun 2011 15:57:40 GMT
Author: mduerig
Date: Thu Jun 16 15:57:39 2011
New Revision: 1136501

URL: http://svn.apache.org/viewvc?rev=1136501&view=rev
Log:
JCR-2994: Add method to remove mappings from NamespaceMapping

Modified:
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java?rev=1136501&r1=1136500&r2=1136501&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java
Thu Jun 16 15:57:39 2011
@@ -114,6 +114,21 @@ public class NamespaceMapping implements
     }
 
     /**
+     * Clear the mapping for an URI
+     *
+     * @param uri  URI to clear the mapping for
+     * @return  The prefix the URI was mapped to or <code>null</code> if it was
not mapped.
+     */
+    public String removeMapping(String uri) {
+        String prefix = URIToPrefix.remove(uri);
+        if (prefix != null) {
+            prefixToURI.remove(prefix);
+        }
+
+        return prefix;
+    }
+
+    /**
      * Return a Map of prefix to URI mappings currently registered.
      * The returned Map is a copy of the internal Map.
      * @return Map



Mime
View raw message