annotate src/de/mpiwg/itgroup/eSciDoc/Tools/FoxmlNameSpaceContext.java @ 0:c6929e63b0b8

first import
author dwinter
date Wed, 24 Nov 2010 16:52:07 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c6929e63b0b8 first import
dwinter
parents:
diff changeset
1 package de.mpiwg.itgroup.eSciDoc.Tools;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
2 import java.util.Iterator;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
3
c6929e63b0b8 first import
dwinter
parents:
diff changeset
4 import javax.xml.XMLConstants;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
5 import javax.xml.namespace.NamespaceContext;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
6
c6929e63b0b8 first import
dwinter
parents:
diff changeset
7
c6929e63b0b8 first import
dwinter
parents:
diff changeset
8 public class FoxmlNameSpaceContext implements NamespaceContext {
c6929e63b0b8 first import
dwinter
parents:
diff changeset
9 public static final String DC = "http://purl.org/dc/elements/1.1/";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
10 private static final String OAI = "http://www.openarchives.org/OAI/2.0/oai_dc/";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
11 static public String FOXML = "info:fedora/fedora-system:def/foxml#";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
12 static public String VLP = "http://www.mpiwg-berlin.mpg.de/ns/vlp";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
13 static public String MPIWG = "http://www.mpiwg-berlin.mpg.de/ns/mpiwg";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
14 static public String RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
15 static public String FEDORA = "info:fedora/fedora-system:def/relations-external#";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
16
c6929e63b0b8 first import
dwinter
parents:
diff changeset
17 public String getNamespaceURI(String prefix) {
c6929e63b0b8 first import
dwinter
parents:
diff changeset
18 if (prefix.equals("foxml"))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
19 return FOXML;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
20 else if (prefix.equals("oai_dc"))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
21 return OAI;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
22 else if (prefix.equals("dc"))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
23 return DC;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
24 else if (prefix.equals("vlp"))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
25 return VLP;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
26 else if (prefix.equals("mpiwg"))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
27 return MPIWG;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
28 else if (prefix.equals("rdf"))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
29 return RDF;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
30 else if (prefix.equals("fedora"))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
31 return FEDORA;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
32
c6929e63b0b8 first import
dwinter
parents:
diff changeset
33 else
c6929e63b0b8 first import
dwinter
parents:
diff changeset
34 return XMLConstants.NULL_NS_URI;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
35 }
c6929e63b0b8 first import
dwinter
parents:
diff changeset
36
c6929e63b0b8 first import
dwinter
parents:
diff changeset
37 public String getPrefix(String namespaceURI) {
c6929e63b0b8 first import
dwinter
parents:
diff changeset
38 if (namespaceURI.equals(FOXML))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
39 return "foxml";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
40 else if (namespaceURI.equals(OAI))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
41 return "oai_dc";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
42 else if (namespaceURI.equals(DC))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
43 return "dc";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
44 else if (namespaceURI.equals(VLP))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
45 return "vlp";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
46 else if (namespaceURI.equals(MPIWG))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
47 return "mpiwg";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
48 else if (namespaceURI.equals(RDF))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
49 return "rdf";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
50 else if (namespaceURI.equals(FEDORA))
c6929e63b0b8 first import
dwinter
parents:
diff changeset
51 return "fedora";
c6929e63b0b8 first import
dwinter
parents:
diff changeset
52 else
c6929e63b0b8 first import
dwinter
parents:
diff changeset
53 return null;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
54 }
c6929e63b0b8 first import
dwinter
parents:
diff changeset
55
c6929e63b0b8 first import
dwinter
parents:
diff changeset
56 public Iterator getPrefixes(String namespaceURI) {
c6929e63b0b8 first import
dwinter
parents:
diff changeset
57 // TODO Auto-generated method stub
c6929e63b0b8 first import
dwinter
parents:
diff changeset
58 return null;
c6929e63b0b8 first import
dwinter
parents:
diff changeset
59 }
c6929e63b0b8 first import
dwinter
parents:
diff changeset
60
c6929e63b0b8 first import
dwinter
parents:
diff changeset
61 }