comparison src/main/java/org/dive4elements/artifacts/httpclient/utils/XFormNamespaceContext.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/XFormNamespaceContext.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: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