comparison src/main/java/org/dive4elements/artifacts/httpclient/utils/ArtifactNamespaceContext.java @ 71:a857866d162f

Moved directories to org.dive4elements
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 11:14:14 +0200
parents src/main/java/de/intevation/artifacts/httpclient/utils/ArtifactNamespaceContext.java@a1db30b33f43
children 133281653904
comparison
equal deleted inserted replaced
70:da691e917f98 71:a857866d162f
1 /*
2 * Copyright (c) 2010 by Intevation GmbH
3 *
4 * This program is free software under the LGPL (>=v2.1)
5 * Read the file LGPL.txt coming with the software for details
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
7 */
8
9 package de.intevation.artifacts.httpclient.utils;
10
11 import java.util.Iterator;
12
13 import javax.xml.XMLConstants;
14 import javax.xml.namespace.NamespaceContext;
15
16 /**
17 * The namespacecontext object used in xml documents retrieved by the artifact
18 * server.
19 *
20 * @author <a href="mailto:sascha.teichmann@intevation">Sascha L. Teichmann</a>
21 */
22 public class ArtifactNamespaceContext
23 implements NamespaceContext
24 {
25 /**
26 * The URI of the namespace of the artifacts.
27 */
28 public final static String NAMESPACE_URI = "http://www.intevation.de/2009/artifacts";
29
30 /**
31 * The XML prefix for the artifacts namespace.
32 */
33 public final static String NAMESPACE_PREFIX = "art";
34
35 /**
36 * The singleton instance of this <code>NamespaceContext</code>
37 */
38 public static final ArtifactNamespaceContext INSTANCE =
39 new ArtifactNamespaceContext();
40
41 /**
42 * Constructor
43 */
44 public ArtifactNamespaceContext() {
45 }
46
47 public String getNamespaceURI(String prefix) {
48
49 if (prefix == null) {
50 throw new NullPointerException("Null prefix");
51 }
52
53 if (NAMESPACE_PREFIX.equals(prefix)) {
54 return NAMESPACE_URI;
55 }
56
57 if ("xml".equals(prefix)) {
58 return XMLConstants.XML_NS_URI;
59 }
60
61 return XMLConstants.NULL_NS_URI;
62 }
63
64 public String getPrefix(String uri) {
65 throw new UnsupportedOperationException();
66 }
67
68 public Iterator getPrefixes(String uri) {
69 throw new UnsupportedOperationException();
70 }
71 }
72 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org