Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/server/features/FeaturesNamespaceContext.java @ 8203:238fc722f87a
sed 's/logger/log/g' src/**/*.java
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 13:19:22 +0200 |
parents | ea9eef426962 |
children |
rev | line source |
---|---|
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
9 package org.dive4elements.river.client.server.features; |
3476
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
10 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
11 import java.util.Iterator; |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
12 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
13 import javax.xml.XMLConstants; |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
14 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
15 import javax.xml.namespace.NamespaceContext; |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
16 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
17 public class FeaturesNamespaceContext |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
18 implements NamespaceContext { |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
19 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
20 /** |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
21 * The URI of the namespace of the features. |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
22 */ |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
23 public final static String NAMESPACE_URI = |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
24 "http://www.intevation.de/2012/flys/features"; |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
25 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
26 /** |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
27 * The XML prefix for the features namespace. |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
28 */ |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
29 public final static String NAMESPACE_PREFIX = "ftr"; |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
30 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
31 /** |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
32 * Final instance to be easily used to avoid creation |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
33 * of instances. |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
34 */ |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
35 public static final FeaturesNamespaceContext INSTANCE = |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
36 new FeaturesNamespaceContext(); |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
37 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
38 /** |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
39 * The default constructor. |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
40 */ |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
41 public FeaturesNamespaceContext() { |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
42 } |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
43 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
44 /** |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
45 * @see javax.xml.namespace.NamespaceContext#getNamespaceURI(String) |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
46 * @param prefix The prefix |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
47 * @return The corresponing URI |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
48 */ |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
49 @Override |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
50 public String getNamespaceURI(String prefix) { |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
51 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
52 if (prefix == null) { |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
53 throw new NullPointerException("Null prefix"); |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
54 } |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
55 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
56 if (NAMESPACE_PREFIX.equals(prefix)) { |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
57 return NAMESPACE_URI; |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
58 } |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
59 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
60 if ("xml".equals(prefix)) { |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
61 return XMLConstants.XML_NS_URI; |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
62 } |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
63 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
64 return XMLConstants.NULL_NS_URI; |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
65 } |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
66 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
67 /** |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
68 * @see javax.xml.namespace.NamespaceContext#getPrefix(String) |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
69 * @param uri The URI |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
70 * @return nothing. |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
71 * @throws java.lang.UnsupportedOperationException |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
72 */ |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
73 @Override |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
74 public String getPrefix(String uri) { |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
75 throw new UnsupportedOperationException(); |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
76 } |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
77 |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
78 /** |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
79 * @see javax.xml.namespace.NamespaceContext#getPrefixes(java.lang.String) |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
80 * @param uri The URI |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
81 * @return nothing |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
82 * @throws java.lang.UnsupportedOperationException |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
83 */ |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
84 @Override |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
85 public Iterator getPrefixes(String uri) { |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
86 throw new UnsupportedOperationException(); |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
87 } |
4a6321dd5186
Implement a class representation of features corresponding to roles
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
88 } |