Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/server/features/FeaturesNamespaceContext.java @ 5838:5aa05a7a34b7
Rename modules to more fitting names.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 15:23:37 +0200 |
parents | flys-client/src/main/java/org/dive4elements/river/client/server/features/FeaturesNamespaceContext.java@821a02bbfb4e |
children | 172338b1407f |
comparison
equal
deleted
inserted
replaced
5837:d9901a08d0a6 | 5838:5aa05a7a34b7 |
---|---|
1 package org.dive4elements.river.client.server.features; | |
2 | |
3 import java.util.Iterator; | |
4 | |
5 import javax.xml.XMLConstants; | |
6 | |
7 import javax.xml.namespace.NamespaceContext; | |
8 | |
9 public class FeaturesNamespaceContext | |
10 implements NamespaceContext { | |
11 | |
12 /** | |
13 * The URI of the namespace of the features. | |
14 */ | |
15 public final static String NAMESPACE_URI = | |
16 "http://www.intevation.de/2012/flys/features"; | |
17 | |
18 /** | |
19 * The XML prefix for the features namespace. | |
20 */ | |
21 public final static String NAMESPACE_PREFIX = "ftr"; | |
22 | |
23 /** | |
24 * Final instance to be easily used to avoid creation | |
25 * of instances. | |
26 */ | |
27 public static final FeaturesNamespaceContext INSTANCE = | |
28 new FeaturesNamespaceContext(); | |
29 | |
30 /** | |
31 * The default constructor. | |
32 */ | |
33 public FeaturesNamespaceContext() { | |
34 } | |
35 | |
36 /** | |
37 * @see javax.xml.namespace.NamespaceContext#getNamespaceURI(String) | |
38 * @param prefix The prefix | |
39 * @return The corresponing URI | |
40 */ | |
41 @Override | |
42 public String getNamespaceURI(String prefix) { | |
43 | |
44 if (prefix == null) { | |
45 throw new NullPointerException("Null prefix"); | |
46 } | |
47 | |
48 if (NAMESPACE_PREFIX.equals(prefix)) { | |
49 return NAMESPACE_URI; | |
50 } | |
51 | |
52 if ("xml".equals(prefix)) { | |
53 return XMLConstants.XML_NS_URI; | |
54 } | |
55 | |
56 return XMLConstants.NULL_NS_URI; | |
57 } | |
58 | |
59 /** | |
60 * @see javax.xml.namespace.NamespaceContext#getPrefix(String) | |
61 * @param uri The URI | |
62 * @return nothing. | |
63 * @throws java.lang.UnsupportedOperationException | |
64 */ | |
65 @Override | |
66 public String getPrefix(String uri) { | |
67 throw new UnsupportedOperationException(); | |
68 } | |
69 | |
70 /** | |
71 * @see javax.xml.namespace.NamespaceContext#getPrefixes(java.lang.String) | |
72 * @param uri The URI | |
73 * @return nothing | |
74 * @throws java.lang.UnsupportedOperationException | |
75 */ | |
76 @Override | |
77 public Iterator getPrefixes(String uri) { | |
78 throw new UnsupportedOperationException(); | |
79 } | |
80 } |