comparison src/main/java/de/intevation/artifacts/httpclient/utils/XFormNamespaceContext.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:ingo.weinzierl@intevation">Ingo Weinzierl</a>
21 */
22 public class XFormNamespaceContext
23 implements NamespaceContext
24 {
25 public final static String NAMESPACE_URI = "http://www.w3.org/2002/xforms";
26
27 public final static String NAMESPACE_PREFIX = "xform";
28
29 public static final XFormNamespaceContext INSTANCE =
30 new XFormNamespaceContext();
31
32 /**
33 * Constructor
34 */
35 public XFormNamespaceContext() {
36 }
37
38 public String getNamespaceURI(String prefix) {
39
40 if (prefix == null) {
41 throw new NullPointerException("Null prefix");
42 }
43
44 if (NAMESPACE_PREFIX.equals(prefix)) {
45 return NAMESPACE_URI;
46 }
47
48 if ("xml".equals(prefix)) {
49 return XMLConstants.XML_NS_URI;
50 }
51
52 return XMLConstants.NULL_NS_URI;
53 }
54
55 public String getPrefix(String uri) {
56 throw new UnsupportedOperationException();
57 }
58
59 public Iterator getPrefixes(String uri) {
60 throw new UnsupportedOperationException();
61 }
62 }
63 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org