Mercurial > dive4elements > http-client
comparison src/main/java/de/intevation/artifacts/httpclient/utils/ArtifactNamespaceContext.java @ 0:a1db30b33f43
Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
http-client/trunk@1323 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 17 Feb 2011 10:31:40 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a1db30b33f43 |
---|---|
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 : |