Return-Path: Delivered-To: apmail-ws-wsrf-commits-archive@www.apache.org Received: (qmail 43410 invoked from network); 23 Sep 2005 21:54:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Sep 2005 21:54:06 -0000 Received: (qmail 94803 invoked by uid 500); 23 Sep 2005 21:54:06 -0000 Delivered-To: apmail-ws-wsrf-commits-archive@ws.apache.org Received: (qmail 94780 invoked by uid 500); 23 Sep 2005 21:54:06 -0000 Mailing-List: contact wsrf-commits-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: wsrf-dev@ws.apache.org Delivered-To: mailing list wsrf-commits@ws.apache.org Received: (qmail 94767 invoked by uid 500); 23 Sep 2005 21:54:06 -0000 Delivered-To: apmail-ws-wsrf-cvs@ws.apache.org Received: (qmail 94764 invoked by uid 99); 23 Sep 2005 21:54:06 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 23 Sep 2005 14:54:05 -0700 Received: (qmail 43340 invoked by uid 65534); 23 Sep 2005 21:53:45 -0000 Message-ID: <20050923215345.43339.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: wsrf-cvs@ws.apache.org From: ips@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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( ); + } + +}