diff flys-client/src/main/java/org/dive4elements/river/client/server/features/FeaturesNamespaceContext.java @ 5834:f507086aa94b

Repaired internal references.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 12:31:32 +0200
parents flys-client/src/main/java/de/intevation/flys/client/server/features/FeaturesNamespaceContext.java@4a6321dd5186
children 821a02bbfb4e
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/org/dive4elements/river/client/server/features/FeaturesNamespaceContext.java	Thu Apr 25 12:31:32 2013 +0200
@@ -0,0 +1,80 @@
+package de.intevation.flys.client.server.features;
+
+import java.util.Iterator;
+
+import javax.xml.XMLConstants;
+
+import javax.xml.namespace.NamespaceContext;
+
+public class FeaturesNamespaceContext
+implements   NamespaceContext {
+
+    /**
+     * The URI of the namespace of the features.
+     */
+    public final static String NAMESPACE_URI =
+        "http://www.intevation.de/2012/flys/features";
+
+    /**
+     * The XML prefix for the features namespace.
+     */
+    public final static String NAMESPACE_PREFIX = "ftr";
+
+    /**
+     * Final instance to be easily used to avoid creation
+     * of instances.
+     */
+    public static final FeaturesNamespaceContext INSTANCE =
+        new FeaturesNamespaceContext();
+
+    /**
+     * The default constructor.
+     */
+    public FeaturesNamespaceContext() {
+    }
+
+    /**
+     * @see javax.xml.namespace.NamespaceContext#getNamespaceURI(String)
+     * @param prefix The prefix
+     * @return The corresponing URI
+     */
+    @Override
+    public String getNamespaceURI(String prefix) {
+
+        if (prefix == null) {
+            throw new NullPointerException("Null prefix");
+        }
+
+        if (NAMESPACE_PREFIX.equals(prefix)) {
+            return NAMESPACE_URI;
+        }
+
+        if ("xml".equals(prefix)) {
+            return XMLConstants.XML_NS_URI;
+        }
+
+        return XMLConstants.NULL_NS_URI;
+    }
+
+    /**
+     * @see javax.xml.namespace.NamespaceContext#getPrefix(String)
+     * @param uri The URI
+     * @return nothing.
+     * @throws java.lang.UnsupportedOperationException
+     */
+    @Override
+    public String getPrefix(String uri) {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @see javax.xml.namespace.NamespaceContext#getPrefixes(java.lang.String)
+     * @param uri The URI
+     * @return nothing
+     * @throws java.lang.UnsupportedOperationException
+     */
+    @Override
+    public Iterator getPrefixes(String uri) {
+        throw new UnsupportedOperationException();
+    }
+}

http://dive4elements.wald.intevation.org