comparison flys-client/src/main/java/de/intevation/flys/client/server/features/FeaturesNamespaceContext.java @ 3476:4a6321dd5186

Implement a class representation of features corresponding to roles flys-client/trunk@5171 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Bjoern Ricks <bjoern.ricks@intevation.de>
date Wed, 08 Aug 2012 12:51:18 +0000
parents
children
comparison
equal deleted inserted replaced
3475:9b29facddbd1 3476:4a6321dd5186
1 package de.intevation.flys.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 }

http://dive4elements.wald.intevation.org