X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Futil%2Fxml%2FHardcodedNamespaceResolver.java;fp=opendaylight%2Fnetconf%2Fnetconf-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Futil%2Fxml%2FHardcodedNamespaceResolver.java;h=0000000000000000000000000000000000000000;hp=87ecb2de090ec8813d0bd0215cde1ade3bfcddd9;hb=9ba2b4eca79bcc0e78099b133296801c8d45a6c4;hpb=b2e81149739c87f0ecc2ce7f06448d7a5d3162b8 diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/HardcodedNamespaceResolver.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/HardcodedNamespaceResolver.java deleted file mode 100644 index 87ecb2de09..0000000000 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/HardcodedNamespaceResolver.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -package org.opendaylight.controller.netconf.util.xml; - -import com.google.common.collect.ImmutableMap; -import java.util.Collections; -import java.util.Iterator; -import java.util.Map; -import javax.xml.namespace.NamespaceContext; - -// http://www.ibm.com/developerworks/library/x-nmspccontext/ -public class HardcodedNamespaceResolver implements NamespaceContext { - private final Map prefixesToNamespaces; - - public HardcodedNamespaceResolver(String prefix, String namespace) { - this(ImmutableMap.of(prefix, namespace)); - } - - public HardcodedNamespaceResolver(Map prefixesToNamespaces) { - this.prefixesToNamespaces = Collections.unmodifiableMap(prefixesToNamespaces); - } - - /** - * This method returns the uri for all prefixes needed. Wherever possible it - * uses XMLConstants. - * - * @param prefix - * @return uri - */ - @Override - public String getNamespaceURI(String prefix) { - if (prefixesToNamespaces.containsKey(prefix)) { - return prefixesToNamespaces.get(prefix); - } else { - throw new IllegalStateException("Prefix mapping not found for " + prefix); - } - } - - @Override - public String getPrefix(String namespaceURI) { - // Not needed in this context. - return null; - } - - @Override - public Iterator getPrefixes(String namespaceURI) { - // Not needed in this context. - return null; - } - -}