ws-wsrf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r291209 - /webservices/wsrf/trunk/src/java/org/apache/ws/util/xml/impl/BasicNamespaceContext.java
Date Fri, 23 Sep 2005 21:53:45 GMT
Author: ips
Date: Fri Sep 23 14:53:42 2005
New Revision: 291209

URL: http://svn.apache.org/viewcvs?rev=291209&view=rev
Log:
new class

Added:
    webservices/wsrf/trunk/src/java/org/apache/ws/util/xml/impl/BasicNamespaceContext.java

Added: webservices/wsrf/trunk/src/java/org/apache/ws/util/xml/impl/BasicNamespaceContext.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/util/xml/impl/BasicNamespaceContext.java?rev=291209&view=auto
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/util/xml/impl/BasicNamespaceContext.java
(added)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/util/xml/impl/BasicNamespaceContext.java
Fri Sep 23 14:53:42 2005
@@ -0,0 +1,63 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.util.xml.impl;
+
+import org.apache.ws.util.xml.NamespaceContext;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
+
+/**
+ * TODO
+ */
+public class BasicNamespaceContext implements NamespaceContext
+{
+
+    private Map prefixToNsMap = Collections.synchronizedMap( new HashMap() );
+    private Map nsToPrefixMap = Collections.synchronizedMap( new HashMap() );
+
+    public void addPrefixToNamespaceURIMapping( String prefix, String namespaceURI )
+    {
+       prefixToNsMap.put( prefix, namespaceURI );
+       nsToPrefixMap.put( namespaceURI, prefix );
+    }
+
+    public String getNamespaceURI( String prefix )
+    {
+        return (String) prefixToNsMap.get( prefix );
+    }
+
+    public String getPrefix( String namespaceURI )
+    {
+        return (String) nsToPrefixMap.get( namespaceURI );
+    }
+
+    public Iterator getPrefixes( String namespaceURI )
+    {
+        List prefixes = new ArrayList(  );
+        String prefix = getPrefix( namespaceURI );
+        if ( prefix != null )
+        {
+            prefixes.add( prefix );
+        }
+        return prefixes.iterator(  );
+    }
+
+}



Mime
View raw message