Mercurial > dive4elements > framework
comparison artifacts/src/main/java/de/intevation/artifacts/ArtifactNamespaceContext.java @ 24:d5dc2900392f
* Added callback parameter to Artifact.setup()
* New namespace context for artifacts.
artifacts/trunk@58 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 10 Sep 2009 08:57:09 +0000 |
parents | |
children | 83a059c204f8 |
comparison
equal
deleted
inserted
replaced
23:00596a591a2f | 24:d5dc2900392f |
---|---|
1 package de.intevation.artifacts; | |
2 | |
3 import javax.xml.XMLConstants; | |
4 | |
5 import javax.xml.namespace.NamespaceContext; | |
6 | |
7 import java.util.Iterator; | |
8 | |
9 /** | |
10 * @author Sascha L. Teichmann (sascha.teichmann@intevation) | |
11 */ | |
12 public class ArtifactNamespaceContext | |
13 implements NamespaceContext | |
14 { | |
15 /** | |
16 * The URI of the namespace of the artifacts. | |
17 */ | |
18 public final static String NAMESPACE_URI = "http://www.intevation.de/2009/artifacts"; | |
19 | |
20 /** | |
21 * The XML prefix for the artifacts namespace. | |
22 */ | |
23 public final static String NAMESPACE_PREFIX = "art"; | |
24 | |
25 public ArtifactNamespaceContext() { | |
26 } | |
27 | |
28 public String getNamespaceURI(String prefix) { | |
29 | |
30 if (prefix == null) { | |
31 throw new NullPointerException("Null prefix"); | |
32 } | |
33 | |
34 if (NAMESPACE_PREFIX.equals(prefix)) { | |
35 return NAMESPACE_URI; | |
36 } | |
37 | |
38 if ("xml".equals(prefix)) { | |
39 return XMLConstants.XML_NS_URI; | |
40 } | |
41 | |
42 return XMLConstants.NULL_NS_URI; | |
43 } | |
44 | |
45 public String getPrefix(String uri) { | |
46 throw new UnsupportedOperationException(); | |
47 } | |
48 | |
49 public Iterator getPrefixes(String uri) { | |
50 throw new UnsupportedOperationException(); | |
51 } | |
52 } | |
53 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: |